President Barack Obama pledged on Tuesday that the United States would defend South Korea after an attack by North Korea the White House branded as provocative and outrageous.

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

Trying to avoid any escalation in the situation, the U.S. did not reposition any of its 29,000 troops in South Korea. Speaking to ABC News, the president 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 co-operation 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.

Earlier, South Korea's president said Tuesday the country will unleash "enormous retaliation" should North Korea attack again.

tp-korea-smoke-cp-9801755

Smoke rises from South Korea's Yeonpyeong Island near the border with North Korea on Tuesday.

Lee Myung-bak said "indiscriminate attack on civilians can never be tolerated." His comments were posted on the presidential website and made during a visit to the Joint Chiefs of Staff command and control room.

The terse warning follows an exchange of artillery fire between the bitter neighbours after the North shelled an island near their disputed sea border, killing at least two South Korean marines, setting dozens of buildings ablaze and sending civilians fleeing for shelter.

Canada responds

In Ottawa, Prime Minister Stephen Harper strongly condemned the artillery attack, calling it "the latest in a series of aggressive and provocative actions by North Korea, which continue to represent a grave threat to international security and stability in northeast Asia."

Harper extended his condolences to the families of the two South Korean military officers killed in the attack and urged North Korea "to refrain from further reckless and belligerent actions and to abide by the Korean Armistice Agreement."

Last month, Canada announced it would adopt a "controlled engagement policy," terminating all official bilateral contacts with North Korea, with the exception of those necessary to address regional security concerns and human rights.

Speaking to reporters outside the House of Commons, Foreign Affairs Minister Lawrence Cannon said the government is closely monitoring the situation.

"This is the second time this year that the North Korean regime has recklessly caused loss of life in South Korea through aggressive military actions [which] continue to pose a grave threat to the region and to the entire world."

Cannon said it would be appropriate for the United Nations Security Council to get active on the file.

That council could hold an emergency meeting in the next day or two to discuss the attacks, a French diplomat said.

"It's in the works for either today or tomorrow," a French diplomat was quoted by Reuters.

The skirmish began when Pyongyang warned the South to halt military drills in the area, according to South Korean officials. When Seoul refused, the North bombarded the small South Korean-held island of Yeonpyeong, which houses military installations and a small civilian population.

Escalation of skirmishes

South Korea returned fire and dispatched fighter jets in response, and said there could be considerable North Korean casualties as troops unleashed intense retaliatory fire.

The supreme military command in Pyongyang threatened more strikes if the South crossed their maritime border by "even 0.001 millimetre," according to the North's official Korean Central News Agency.

Government officials in Seoul called the bombardments "inhumane atrocities" that violated the 1953 armistice halting the Korean War. The two sides technically remain at war because a peace treaty was never signed.

World condemns attack

UN Secretary General Ban Ki-moon condemned the attack and conveyed his concerns to the Security Council's president.

Ban called the attack "one of the gravest incidents since the end of the Korean War," spokesman Martin Nesirky said.

China, the North's economic and political benefactor, which also maintains close commercial ties to the South, appealed to both sides to remain calm and "to do more to contribute to peace and stability on the peninsula," Foreign Ministry spokesman Hong Lei said.

koreas-yeonpyeong-200

The North bombarded the small South Korean-held island of Yeonpyeong, which houses military installations and a small civilian population. ((CBC))

North Korea fired dozens of rounds of artillery in three separate barrages that began in the mid-afternoon, while South Korea returned fire with about 80 rounds, South Korea's Joint Chiefs of Staff said.

Two South Korean marines were killed and 16 injured, the Joint Chiefs of Staff said. Island residents escaped to 20 shelters on the island and sporadic shelling ended after about an hour, according to the military.

The skirmish occurred a day after the South Korean military began holding drills in the area, exercises that North Korea's military demanded an end to early Tuesday, the JCS said.

South Korean marines participating in the drill had been shooting artillery during those drills, but toward southern waters, away from North Korea, a military official said, speaking on condition of anonymity due to military rules.

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

In March, a South Korean warship went down in the waters while on a routine patrolling mission. Forty-six sailors were killed in what South Korea calls the worst military attack on the country since the Korean War.

Seoul blamed a North Korean torpedo, but Pyongyang denied responsibility.