INCHEON, South Korea — North and South Korea exchanged artillery fire along their disputed frontier, raising tensions between the rivals to their highest level in more than a decade. The communist nation warned of more military strikes if the South encroaches on the maritime border by even a fraction of a millimeter.

The skirmish began Tuesday when North Korea warned the South to halt military drills near their sea border, according to South Korean officials. When Seoul refused and began firing artillery into disputed waters – but away from the North Korean shore — the North retaliated by shelling the small island of Yeonpyeong, which houses South Korean military installations and a small civilian population.

Seoul responded by unleashing its own barrage from K-9 155mm self-propelled howitzers and by scrambling fighter jets.

Two South Korean marines were killed in the shelling, which also injured 15 troops and three civilians. Officials in Seoul said there could be considerable North Korean casualties.

President Obama pledged that the U.S. would defend South Korea after what the White House branded a provocative, outrageous attack by North Korea on its neighbor.

“South Korea is our ally. It has been since the Korean war,” Obama said in his first comments about the North Korean shelling. “And we strongly affirm our commitment to defend South Korea as part of that alliance.”

Trying to avoid any escalation, the U.S. did not reposition any of its 29,000 troops in the South. Obama, speaking to ABC News, declined to speculate when asked about military options. He was expected to telephone South Korean President Lee Myung-bak late Tuesday night.

The top U.S. military officer in South Korea, Gen. Walter Sharp, condemned North Korea’s “unprovoked” artillery attack in a statement today and called on the North to abide by the armistice that ended the 1950-53 Korean War.

“These actions are threatening the peace and stability of the entire region,” said Sharp, who commands U.S. forces in South Korea as well as the U.S.-led UN Command.

The UN Command called for high-level military talks between the Koreas at the truce village of Panmunjom at the divided border to “de-escalate the situation,” the statement said.

The confrontation lasted about an hour and left the uneasiest of calms, with each side threatening further bombardments.

North Korea’s apparent progress in its nuclear weapons program and its preparations for handing power to a new generation have plunged relations on the heavily militarized peninsula to new lows in recent weeks.

South Korea’s military was put on high alert after the shelling — one of the rivals’ most dramatic confrontations since the 1953 armistice and one of the few to put civilians at risk.

“I thought I would die,” said Lee Chun-ok, 54, an islander who said she was watching TV in her home when the shelling began. Suddenly, a wall and door collapsed.

“I was really, really terrified,” she told The Associated Press after being evacuated to the port city of Incheon, west of Seoul, “and I’m still terrified.”

The attacks focused global attention on the tiny island and sent stock prices down worldwide.

The South Korean president, who convened an emergency security meeting shortly after the initial bombardment, said an “indiscriminate attack on civilians can never be tolerated.”

“Enormous retaliation should be made to the extent that (North Korea) cannot make provocations again,” Lee said.

China, the North’s economic and political benefactor, which also maintains close commercial ties to the South, appealed for both sides to remain calm.

U.N. Secretary-General Ban Ki-moon called for “immediate restraint” and condemned North Korea’s artillery attack as “one of the gravest incidents since the end of the Korean War,” said his spokesman, Martin Nesirky.

The clash “brings us one step closer to the brink of war,” said Peter Beck, a research fellow with the Council on Foreign Relations, “because I don’t think the North would seek war by intention, but war by accident, something spiraling out of control has always been my fear.”

North Korea does not recognize the western maritime border drawn unilaterally by the U.N. at the close of the conflict, and the Koreas have fought three bloody skirmishes there in recent years.