The death toll in the South Korean accident stood at 58 as of Sunday, with 244 missing.

Most countries do not explicitly state that a captain must be the last person to leave a distressed ship, experts say, giving captains the leeway to board lifeboats or nearby ships if they can better command an evacuation from there. South Korea’s law, however, appears to be explicit, allowing the authorities to arrest Mr. Lee for abandoning the boat and its passengers in a time of crisis. An international maritime treaty known as the Safety of Life at Sea — first adopted in 1914 after the Titanic disaster — makes a ship’s captain responsible for the safety of his vessel and everyone on board. A later version of the treaty said that passengers should be able to evacuate within 30 minutes of a general alarm.

The Sewol took two and a half hours to sink, but many survivors have reported that the crew told passengers it was safer to stay put inside the ship, likely dooming them. (The captain says he later issued instructions for passengers to evacuate the ship, but it remains unclear if that was conveyed to passengers.)

The United States Navy’s rules are more explicit than ones for commercial ships. Dave Werner, Naval History and Heritage Command spokesman, said that Navy rules dating to 1814 require a captain to remain with a stricken ship as long as possible and salvage as much of it as he can.

Mr. Werner cited current regulations that state, “If it becomes necessary to abandon the ship, the commanding officer should be the last person to leave.”

The list of military and commercial ship captains who refused to abandon ship is a long one.

The Titanic’s captain, E. J. Smith, was probably steaming too fast when the giant ship hit an iceberg, but he later won praise for helping to save more than 700 lives. He insisted that women and children be evacuated first, and he stayed near the bridge as the ship went down.

After the Andrea Doria collided with another vessel off Nantucket in 1956, the captain, Piero Calamai, pledged to remain on his own on the listing ship after the passengers were evacuated to try to save it. He agreed to abandon the vessel only when other officers refused to leave without him.

When the Navy’s first Cold War spy submarine, the Cochino, caught fire and was about to sink in the Barents Sea not far from Russia in 1949, the captain, Cmdr. Rafael C. Benitez, refused to abandon the surfaced submarine even after all his men had run across a wooden plank connecting them to another vessel heaving in the rough seas.