Libya's National Oil Corporation (NOC) said the country's eastern government attempted to export 650,000 barrels of oil this week, but that workers at the Marsa el-Hariga terminal had refused to load the shipment.
"This had the potential to be a very ugly incident and I am pleased that it has been resolved peacefully without injury to anybody or loss of revenue or damage to the integrity of NOC or the country," Tripoli-based Chairman Mustafa Sanalla said in a statement released late on Friday.
Libya's eastern government is one of two rival administrations set up in 2014. Its efforts to sell oil through a parallel oil company have so far been unsuccessful.
The NOC has said it will work with a U.N.-backed unity government that arrived in Tripoli last month to coordinate future oil sales.
There was no immediate comment from the eastern government or the parallel oil company that it formed in Benghazi, Libya's second city.
Sanalla said he had informed the unity government's prime minister, Fayez Seraj, about the attempted sale, and that Seraj "took the necessary steps to stop the vessel from loading".
The NOC statement said the marketing manager of the parallel company had instructed eastern oil firm Agoco to load the shipment on April 21-23 for DSA Consultancy FZC, a company registered in the United Arab Emirates.
It said the shipment was intended for the Distya Ameya, an Indian-flagged vessel that remained at Marsa el-Hariga.
"Agoco employees and port officials understood this was a political attempt to divide the country, and I am very proud that they resisted the pressure to load this vessel," Sanalla said.
"We have been in communication with the master of the ship," he added. "We have informed him he is breaching U.N. resolutions and we have asked him to leave Libyan waters immediately. He has turned off his vessel's tracking system."
The U.N. Security Council last month said the unity government had the "primary responsibility" for preventing illicit oil sales, urging it to communicate any such attempts to the U.N. committee overseeing Libya-related sanctions.
The resolution also restated a call for member states to cease contact with any "parallel institutions".
Since the uprising that toppled autocrat Muammar Gaddafi five years ago, Libya's oil production has been slashed by rivalry between armed factions, attacks by Islamic State militants and labor disputes.
Output has fallen to less than a quarter of the 1.6 million barrels per day produced before the uprising.