SEOUL — The United States warned North Korea on Monday that its decision fire artillery rounds into South Korean waters was a dangerous step that would further aggravate tensions in the region.

North and South Korea fired hundreds of artillery shells into each other’s waters Monday in a flare-up of animosity that forced residents of five front-line South Korean islands to evacuate to shelters for several hours, South Korean officials said.

The exchange of fire into the Yellow Sea followed Pyongyang’s sudden announcement that it would conduct live-fire drills in seven areas north of the Koreas’ disputed maritime boundary. North Korea routinely test-fires artillery and missiles into the ocean but rarely discloses those plans in advance.

North Korea fired 500 rounds of artillery shells over more than three hours, about 100 of which fell south of the sea boundary, South Korea said. South Korea responded by firing 300 shells into North Korean waters.