Abdullah al-Thinni the newly appointed Libyan Prime Minister is stepping down after he and his family were attacked by a militia.
A statement released by the Prime Minister said that “no one was injured in the attack, but it was very close.”
Mr al-Thinni was only confirmed as PM last week after Ali Zeidan was sacked for failing to improve security.
Libya has been plagued by instability since armed groups toppled Muammar Gaddafi’s regime in 2011.
In a letter published on the government website, Mr al-Thinni said he and his family had been victims of a “cowardly attack” and he could not “accept to see any violence because of my position”.
Details of the attack remain sketchy and it is not clear who was behind it, but it appears to have been carried out on the road to the airport in Tripoli.
Ahmed Lameen, a spokesman for the Prime Minister, told the BBC’s Rana Jawad that Mr al-Thinni and his cabinet would continue in their roles until a new PM was appointed by the Libyan congress.
Mr al-Thinni was appointed earlier this month as interim Prime Minister and his mandate was extended last week on the condition he formed a new government to bring some stability to Libya.
The Libyan cabinet has been in a state of limbo since the sacking of former Prime Minister Ali Zeidan last month.
Mr Zeidan was dismissed by parliament after a North Korea-flagged tanker laden with oil from a rebel-held port was said to have broken through a naval blockade.
The ship and its cargo was eventually handed over to Libyan authorities after the US intervened and sent Navy Seals to board the ship south of Cyprus.