Libya's parliament has ousted the prime minister in a vote of confidence, after his government was embarrassed when a militia controlling an eastern port defied Tripoli's authority by trying to sell oil.
The chamber named the defence minister, Abdullah al-Thinni, as an interim prime minister until a replacement for the embattled Ali Zidan is found.
The "no" vote won the support of 121 MPs out of the approximately 180 that remain in the parliament, according to one MP.
Mr Zidan, whose ousting had been seen as a matter of time to many Libyans, had no immediate public reaction to the vote.
He was elected in 2012 as the first prime minister after the 2011 overthrow and killing of dictator Muammar Gaddafi.
He has had the backing of the liberal-leaning National Forces Alliance against a bloc led by the Islamist group, the Muslim Brotherhood, although parliament is divided as much on regional lines as ideological ones.
Col Gaddafi's 40-year rule left Libya with few strong state institutions, and Mr Zidan has presided over a government that has little authority and is frequently subjected to humiliations. In the absence of a strong military and police force, it relies on militias to keep order - but many defy the government, with one of them briefly abducting Mr Zidan himself last year.
The Islamist-led bloc has long wanted to oust him, although until now it could not drum up the votes. It was not clear if parliament changed sides but Mr Zidan in recent days has appeared particularly helpless. He confessed to reporters on Saturday that the nation's military does not carry out his orders and complained that "everyone is working against the government."
The latest crisis is linked to an autonomy movement in Libya's east, home to most of its oil. Several months ago, a militia seized the key port of al-Sidra and in recent days, the group attempted to load oil into a North Korean-flagged tanker that docked there without government permission.
The government said on Monday that its forces had taken control of the tanker, but the militia denied this.
Underlying Libya's crisis is a dispute over the interim parliament, which reached the end of its mandate in February. Islamists want to extend its term while the other bloc wants new elections.