A South Korean soldier (right) on duty at a guard post at sunrise on Baengnyeong Island, near the West Sea border with North Korea, in April. Residents of Socheong Island (inset) evacuate to a shelter following an exchange of fire between North and South Korean forces. Photo: AP

SEOUL, South Korea — 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 Defense 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.

Residents of Yeonpyeong Island, South Korea, rest after they evacuated to a shelter on the island near the West Sea border with North Korea.Photo: AP

Photo: AP

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 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.

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.

In Washington, a State Department spokeswoman said Thursday the United States was closely monitoring the situation on the Korean Peninsula in coordination with South Korea. She urged North Korea “to refrain from provocative actions that aggravate tensions” and exercise restraint.

North Korea in recent weeks has conducted a string of artillery drills and missile tests and has unleashed a torrent of racist and sexist rhetoric at the leaders of the US 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 US-led UN Command at the end of the 1950-53 Korean War.