Libyan military strongman Khalifa Haftar has announced the "total liberation" of the country's second-largest city, Benghazi, which was overrun by jihadists three years ago.

Mr Haftar does not recognise the authority of the UN-backed Government of National Accord in Tripoli and instead backs a rival parliament based in Tobruk in the country's east.

"After a continuous struggle against terrorism and its agents that lasted more than three years...we announce to you the liberation of Benghazi from terrorism," Mr Haftar, in full military regalia, said in a speech broadcast on television.

"Today Benghazi enters a new era of peace, security, reconciliation ... and reconstruction," he said, paying homage to "a caravan of martyrs" who fell in the battle for the city.

Libyan military strongman Khalifa Haftar

The battle between Mr Haftar's self-styled Libyan National Army and an array of Islamist militants has been part of a broader conflict since Libya slipped into turmoil following the fall of dictator Muammar Gaddafi in 2011.

Mr Haftar has established military control over much of eastern Libya.

Having seized a string of key oil ports and southern air bases since last year, he has made little secret of his ambition to enter Tripoli, where he portrays his rivals as beholden to Islamists and militia rule.

He has backing from foreign powers including Egypt and the United Arab Emirates, and has cultivated closer ties with Russia.