The tanker docked at Sidra without government permission
Secrets of the Sahara
'I witnessed Benghazi uprising'
Guide to the militias
Land of the gun
Libya's parliament has dismissed PM Ali Zeidan after a tanker laden with oil from a rebel-held port reportedly broke through a naval blockade.
MPs called a vote of confidence in Mr Zeidan after they were told the North Korean-flagged ship had escaped to sea.
Defence Minister Abdullah al-Thinni was named interim prime minister.
Earlier, Libyan officials had said they had "complete control" of the tanker as it tried to leave the port of Sidra. But the rebels rejected the assertion.
Rana JawadBBC News, Tripoli
In the long-term, the debate is not really over whether Mr Zeidan's departure will help or make matters worse.
That is because many people want to know if Libya's political players can set their differences aside long enough to allow any prime minister or government to rule the country effectively.
There are deepening social, ideological, and regional fault-lines. The real power lies with the guns, and the guns are with competing militia brigades, some of whom have aligned themselves to opposing political parties and even to the ousted prime minister.
If Libya's most pressing needs - disarmament, an effective army, and a consensus between political parties - are not dealt with, it ultimately will not make a difference who is in power. In recent months, there has been more public pressure on the General National Congress, who many want dissolved, than on the prime minister and his cabinet.
Separatist militants have occupied three major eastern ports since August.
They are seeking a greater share of the country's oil revenues, as well as autonomy for the historic eastern region of Cyrenaica.
The tanker - named Morning Glory - was reported to have taken on at least 234,000 barrels of crude at Sidra's oil terminal.
It was the first vessel to have loaded oil from a rebel-held port since the separatist revolt against the central government in Tripoli erupted in July.
The government is still struggling to assert its authority over the armed groups and tribesmen who helped topple Muammar Gaddafi in 2011.
The BBC's Rana Jawad in Tripoli says Mr Zeidan's removal is likely to raise more concerns over the stability of Libya as it struggles to maintain control over large parts of the country.
Members of Libya's parliament, the General National Congress, said that bad weather had stopped the navy's ships from following the tanker into the Mediterranean from Sidra.
Abdelkader Houili, a member of the GNC's energy committee, told al-Nabaa TV that the navy vessels had been forced to sail close to the coast.
Libyan regions had federal powers from 1951 to 1963
"The tanker then took advantage of the gap to head for the open sea," he said.
Analysts say it is unlikely the ship is owned or controlled by North Korea and it is probably sailing under a flag of convenience to keep its true ownership secret.
On Monday, the GNC ordered a special force to be deployed to "liberate" all rebel-held oil terminals. The operation is due to start within one week.
Libya's government has tried to curb protests at oil fields and ports, which have seen vital oil revenues plummet.
Ali Zeidan had said the tanker was under his government's control
However, there has been little progress at the indirect talks between officials and Ibrahim Jathran, a former anti-Gaddafi militia leader and regional head of the Petroleum Facilities Guard who is now leading the protests.
His demands include the formation of an independent commission representing the three historic regions of Libya, which will supervise the sale of oil and ensure the country's east gets a greater share of revenues.
Libya's oil output has slowed to a trickle since the protests started in July last year, depriving the Opec producer of its main budget source