SEOUL, South Korea — President Obama arrived here on Friday offering solace to a country traumatized by the sinking of a ferry that killed scores, and showing solidarity at a time when the Korean Peninsula is rife with tension.

With North Korea threatening provocations like long-range missile tests or even a fourth test of a nuclear weapon, Mr. Obama warned that the United States, South Korea and their allies would consider levying new sanctions against Pyongyang.

“It is important for us to look at additional ways to apply pressure on North Korea, further sanctions that have even more bite,” Mr. Obama said after meeting with President Park Geun-hye of South Korea.

But Mr. Obama acknowledged that diplomatic pressure alone would have limited impact on a government that does not play by the normal rules of diplomacy.