"South Korea is our ally. It has been since the Korean war," Obama said in his first comments about the North Korean shelling of a South Korean island early Tuesday. "And we strongly affirm our commitment to defend South Korea as part of that alliance."
Working to head off any escalation, the U.S. did not reposition any of its 29,000 troops in the South or make other military moves after North Korea fired salvos of shells into the island, setting off an artillery duel between the two sides.
The president, speaking to ABC News, would not speculate when asked about military options.
Obama called South Korean President Lee Myung-bak later Tuesday night, saying the U.S. would work with the international community to strongly condemn the attack that killed the two South Koreans and injured many more, the White House said.
The White House said the two presidents agreed to hold combined military exercises and enhanced training in the days ahead to continue the close security cooperation between the two countries.
Obama assured Lee that "the United States stands shoulder to shoulder with our close friend and ally, the Republic of Korea," the White House statement said.
"President Obama said that North Korea must stop its provocative actions, which will only lead to further isolation, and fully abide by the terms of the armistice agreement and its obligations under international law," the statement said.
The U.S. has relatively few options when dealing with the Pyongyang government. Military action is particularly unappealing, since the unpredictable North possesses crude nuclear weapons as well as a huge standing army. North Korea exists largely outside the system of international financial and diplomatic institutions that the U.S. has used as leverage in dealing with other hostile countries, including Iran.
North Korea has also resisted pressure from its major ally, China, which appears to be nervous about the signs of instability in its neighbor.
"We strongly condemn the attack and we are rallying the international community to put pressure on North Korea," Obama said in the ABC interview, specifically citing the need for China's help. Obama said every nation in the region must know "this is a serious and ongoing threat."
An administration official said Tuesday evening that U.S. officials in Washington and in Beijing were appealing strongly to China to condemn the attack by arguing that it was an act that threatened the stability of the entire region, not just the Korean peninsula. The official spoke on the condition of anonymity because of the sensitivity of the matter.
Defense Secretary Robert Gates phoned South Korea's defense minister to express sympathy for the deaths of two of the South's marines in the artillery shelling of a small South Korean island and to express appreciation "for the restraint shown to date" by the South's government, a Pentagon spokesman said.
Obama called North Korea's action "just one more provocative incident" and said he would consult with Lee on an appropriate response.
In his phone call to South Korea's defense minister, Gates said the U.S. viewed recent attacks as a violation of the armistice agreement that ended the Korea War in 1953, and he reiterated the U.S. commitment to South Korea's defense, said Pentagon press secretary Geoff Morrell.
Obama was awakened at 4 a.m. Tuesday with the news. He went ahead with an Indiana trip focused on the economy before returning to the White House after dark.
State Department spokesman Mark Toner said the U.S. would take a "deliberate approach" in response to what he also called provocative North Korean behavior. At the same time, other administration officials, speaking on condition of anonymity to describe the emerging strategy, said the White House was determined to end a diplomatic cycle that officials said rewards North Korean brinksmanship.
In the past, the U.S. and other nations have sweetened offers to North Korea as it has developed new missiles and prototype nuclear weapons. North Korea is now demanding new one-on-one talks with the United States, which rejects that model in favor of group diplomacy that includes North Korea's protector, China.
"We're not going to respond willy-nilly," Toner said. "We believe that it's important that we keep a unified and measured approach going forward."
Both Republicans and Democrats on Capitol Hill accused North Korea of starting the skirmish.
The violence comes as the North prepares for a dynastic change in leadership and faces a winter of food and electricity shortages. It is the latest of a series of confrontations that have aggravated tensions on the divided peninsula.
The incident also follows the North's decision last week to give visiting Western scientists a tour of a secret uranium enrichment facility, which may signal an expansion of the North's nuclear weapons program. Six weeks ago, North Korean leader Kim Jong Il anointed his youngest son, Kim Jong Un, as his heir apparent.
The administration official said the U.S. did not interpret North Korea's aggression as a desire to go to war, but as yet another effort to extract concessions from the international community.
Pentagon spokesman Col. Dave Lapan said no new equipment or personnel have been relocated to South Korea, while Air Force Chief of Staff Gen. Norton Schwartz seemed to shrug off the latest incident as something that Seoul can handle on its own.
"The North Koreas have undertaken over time a number of provocations that have manifested themselves in different ways," Schwartz said.
The artillery exchange was only the latest serious incident between the two nations. In March, a South Korean naval ship, the Cheonan, exploded and sank in the Yellow Sea, killing 46 sailors. South Korea accused the North of torpedoing the vessel; the North denied the allegation.
In August, the South Korean military reported that the North had fired 110 artillery rounds into the Yellow Sea near the disputed sea border but said the shells fell harmlessly into North Korean waters.
South Korean officials said Tuesday's clash came after Pyongyang warned the South to halt military drills near the small South Korean island of Yeonpyeong.
When Seoul refused and began firing artillery into the water near the disputed sea border, the North bombarded Yeonpyeong, which houses South Korean military installations and a small civilian population.
Recent joint U.S.-Korean naval exercises and strenuous denunciations of the North may only have provoked the regime in Pyongyang. Some experts say the secretive regime may be trying to promote Kim Jong Un as a worthy successor who, like his father, is capable of standing up to the U.S.
"I think it may be all wrapped in this succession planning, in the way the North is looking at it," said Robert RisCassi, a retired Army general who commanded U.S. forces in Korea from 1990-93.
The U.S.-South Korea exercises also angered China. Beijing is regarded as the key to any long-term diplomatic bargain to end North Korea's nuclear program and reduce tensions on the peninsula.
But U.S. officials say the North's motives and internal politics are opaque and sometimes appear inconsistent.
"I don't know the answer to any question about North Korea that begins with the word 'why,"' Gates told reporters Monday.
Associated Press writers Julie Pace, Anne Flaherty, Ben Feller, Jim Kuhnhenn, Pauline Jelinek and Matthew Lee contributed to this report.