Libyan Prime Minister Abdul Hamid Dbeibah survived an assassination attempt after his car was riddled with bullets early on Thursday, a source close to him told Reuters.
The gunmen struck as Mr Dbeibah was returning home and then escaped, said the source, who described the attack as an attempt to kill the prime minister. The incident has been referred for investigation.
No photographs or footage of the incident or its aftermath were obtained by Reuters, who had not spoken to other witnesses.
The incident comes amid intense wrangling over control of the Libyan government.
Mr Dbeibah has said he will ignore a vote scheduled by the eastern-based parliament later on Thursday to replace him.
Parliament members are scheduled to pick between powerful former interior minister Fathi Bashagha, 59, and former interior ministry official Khaled Al Bibass, 51.
Armed forces have increased numbers of troops in the capital Tripoli in recent weeks, stoking fears of fighting that were triggered by the political crisis.
If confirmed, the assassination attempt could aggravate the tensions.
Libya has had little peace or stability since the 2011 Nato-backed uprising against Muammar Qaddafi. The country was split in 2014 between warring factions in the east and west.
Mr Dbeibah was installed in March as head of the UN-backed Government of National Unity (GNU) that was meant to unify the country's divided institutions and oversee the run-up to an election in December as part of a peace process.
Rival factions have been jostling for positions after the election process fell apart over disputes to rules including the legitimacy of Mr Dbeibah's candidacy for president after he pledged not to run.
The parliament, which mostly backed eastern forces during the civil war, has declared the GNU invalid and will hold a vote on Thursday to name a new prime minister to form another government.
Mr Dbeibah said in a speech this week that he would only hand over power after an election and the UN's Libya adviser and Western countries have said they continue to recognise the GNU.
The parliament said this week that no elections would be held this year after it and another political body amended the country's temporary constitution, dismaying the many Libyans who had registered to vote.
The parliament's move to choose a new prime minister may lead to a return to the situation before Mr Dbeibah's unity government was installed, with parallel administrations seeking to rule Libya from different cities.
However, analysts say that may not immediately cause a return to civil war.