North and South Korean warships exchanged artillery fire Thursday in disputed waters off the western coast, South Korean military officials said, in the latest sign of rising animosity between the bitter rivals in recent weeks.

Officials from the South's Joint Chiefs of Staff and Defence Ministry said a South Korean navy ship was engaged in a routine patrol near the countries' disputed maritime boundary in the Yellow Sea when a North Korean navy ship fired two artillery shells. The shells did not hit the South Korean ship and fell in waters near it, they said.

The South Korean ship then fired several artillery rounds in waters near the North Korean ship which also did not hit it, said the officials, who spoke on condition of anonymity because of office rules.

South Korea was trying to determine if the North Korean ship had attempted to hit the South Korean vessel but missed, or if the shells were not meant to hit the ship.

Officials said that residents on the frontline Yeonpyeong Island were evacuated to shelters, and fishing ships in the area were ordered to return to ports. In 2010, North Korea fired artillery at the island, killing two civilians and two marines.

3 bloody naval skirmishes since 1999

Kang Myeong-sung, a Yeonpyeong resident, said in a phone interview that hundreds of residents were in underground shelters after loudspeakers ordered them there. He heard the sound of artillery fire and said many people felt uneasy at first but later began to stop worrying.

Both Koreas regularly conduct artillery drills in the disputed waters. The sea boundary is not clearly marked, and the area has been the scene of three bloody naval skirmishes between the rival Koreas since 1999.

North Korea has in recent weeks conducted a string of artillery drills and missile tests and has unleashed a torrent of racist and sexist rhetoric at the leaders of the U.S. and South Korea.

On Tuesday, South Korean navy ships fired warning shots to repel three North Korean warships that briefly violated the disputed sea boundary. On Wednesday, North Korea's military vowed to retaliate.

North Korean military ships and fishing boats have routinely intruded into South Korean-controlled waters that the North doesn't recognize. The Yellow Sea boundary was unilaterally drawn by the U.S.-led UN Command at the end of the 1950-53 Korean War.