U.S. Navy SEALs have taken control of a commercial tanker that had been seized by three armed Libyans this month.
No one was hurt in the Sunday night operation, the Pentagon said.
The tanker, Morning Glory, is carrying oil owned by Libya's National Oil Company.
The ship was returning to Libya, according to a written statement from the interim prime minister, which said Tripoli asked for help from countries in the area.
The statement thanked the United States and Cyprus.
The Morning Glory sailed last week from the rebel-held port of As-Sidra in eastern Libya
Libyan forces fired on the vessel but were called off by the U.S. Navy, fearing an environmental disaster. The SEALs boarded the ship in international waters southeast of Cyprus, the Pentagon said.
The situation remains unsettled in the North African nation, which the government is struggling to control more than two years after the ouster of longtime Libyan leader Moammar Gadhafi.
In this case, the issue centers around the oil-rich eastern part of the country and one man in particular, Ibrahim Jadran. The militia leader was entrusted by the government to safeguard crucial oil ports. But in July, Jadran and his men seized them, blocking oil exports, and demanded more autonomy and shared revenues for his eastern region.
He said he acted because the government is corrupt.
The conflict over oil wealth is stoking fears that Libya may slide deeper into chaos as the fragile government fails to rein in the armed brigades that helped oust Gadhafi in 2011 but now do as they please.