The Navy’s dramatic Easter Sunday rescue of Capt. Richard Phillips from Somali pirates said a lot about leadership in the United States and lawlessness in Somalia.

Although already deeply engaged with military strategy regarding the ongoing wars in Iraq and Afghanistan, the hostage situation in the Indian Ocean was an early crisis management test for President Obama. Staying true to form, he played it cool — and quiet — by avoiding provocative pronouncements. He even seemed to divert attention over the weekend by allowing more White House talk about his new Portuguese water dog than of the tense situation off the Horn of Africa.

But Obama was clearly engaged, strategizing on what was appropriately the priority — rescuing Phillips unharmed. According to the New York Times, the Defense Department twice asked Obama for permission to use military force in the rescue, and on Saturday the president granted the request only if the captain’s life appeared to be in imminent danger. When that threat became obvious, the Navy snipers hit their targets.

The pirate crisis also showed Somalia for what it is: A textbook definition of a “failed state,” whose lawlessness explains not only why so many have eagerly chosen Minnesota over Mogadishu, but why it is so difficult for courts to repatriate Somali citizens to a nonfunctioning government.

“The real heroes are the Navy, the Seals, those that have brought me home,” Phillips said after the rescue. He’s right, of course. There were a number of heroes — including the captain himself — and steady leadership on the part of Obama. He will no doubt face much larger tests as commander in chief. May they all end this well.