Fathi Bashagha's convoy "was fired on from an armoured car while he was on the highway. His police escort returned fire. Two of the assailants were arrested and a third is in hospital," the source said, adding that "the minister is fine".
Bashagha, a heavyweight in Libyan politics, was returning from a routine visit to a new security unit overseen by his department, the same source said.
The 58-year-old has served as interior minister in the North African country's UN-recognised Government of National Accord since 2018 and has staked his reputation on battling corruption.
Libya has been riven by violence since a 2011 NATO-backed uprising that toppled and killed dictator Muammar Gaddafi.
Two rival administrations, backed by an array of militias and foreign powers, have vied for control of the oil-rich country.
Bashagha had been seen as a favourite to lead a new interim government under UN-led peace efforts following an October ceasefire last year.
The post finally went to businessman Abdul Hamid Dbeibah, a 61-year-old engineer, who has called for reconstruction, democracy and reunification in Libya.
Follow us on Facebook, Twitter and Instagram to stay connected