Libya has had two governments and parliaments since Tripoli was seized in August by the Islamist-backed Fajr Libya militia coalition and the internationally recognised government fled to the country's far east.
On Tuesday lawmakers in the Tripoli-based General National Congress (GNC) voted to sack prime minister Omar al-Hassi, accusing him of failing to tackle corruption.
But Hassi said he was "surprised by the news" of his dismissal, insisting that parliament did not act within the constitution.
"A prime minister cannot be dismissed without questioning," Hassi told a press conference late yesterday.
The internal divisions within the Tripoli administration erupted as Libya's two parliaments hold UN-sponsored talks in Morocco aimed at establishing a provisional unity government.
Libya has been wracked by political turmoil and violence since the 2011 uprising backed by NATO air strikes that ousted and killed dictator Moamer Kadhafi.