Profile: Libyan ex-General Khalifa Haftar
Libya's enigmatic General Khalifa Haftar has been on different sides of almost every power struggle in Libya since the 1960s.
He initially fought for Muammar Gaddafi, then against him. He fought alongside Islamist rebel groups in the uprising that toppled Gaddafi in 2011 before becoming their nemesis this year.
Just as he was fading from the scene, he has re-emerged as the leader of a military campaign against all flavours of Islamists in Libya, from the Muslim Brotherhood to extremist groups.Rise and fall
Alongside Gaddafi, Gen Haftar was part of the cadre of young army officers who seized power from Libya's King Idris in 1969. He remained a close ally of Gaddafi during those years, who promoted him to the role of chief of staff of the armed forces.
Gaddafi rewarded his loyalty by giving him overall command of the conflict with Chad. This proved to be his downfall, as Libya was famously defeated by a ramshackle but determined Chadian force in what came to be known as the Toyota War.
Gen Haftar and 300 of his men were captured by the Chadians in 1987. Having previously denied the presence of Libyan troops in the country, Gaddafi disowned the general, a betrayal which caused him to devote the next two decades towards toppling the Libyan leader.
He did this from exile in the US state of Virginia. His proximity to the CIA's headquarters in Langley hinted at a close relationship with US intelligence services, who gave their backing to several assassination attempts against Gaddafi.
It is likely that he co-operated closely with them in his role as the military chief of the opposition National Front for the Salvation of Libya.Triumphant return
Like many exiled Libyans, Gen Haftar returned to his country during the uprising against Gaddafi.
Because of his military experience, he quickly became one of the main commanders of Libya's makeshift rebel force in the East.
But many rebels were openly suspicious of his involvement, because of his history in Chad and his US connections.
After Gaddafi's downfall, Gen Haftar appeared to have faded into relative obscurity, like other former regime figures who joined the revolution.
That remained the case until February 2014, when TV channels posted a video of him outlining his plan to save the nation and calling on Libyans to rise up against the elected parliament, the General National Congress (GNC).
Precisely nothing happened. Instead, Gen Haftar was largely viewed as a laughing stock for his dramatic announcement of a coup that never was.Anti-Islamist warrior
Since then, however, Gen Haftar appears to have quietly but effectively built support for his campaign among Libya's disparate armed groups, allowing him to back up his rhetoric with serious muscle.
In May, he used warplanes and ground forces to launch a pre-emptive assault against militia bases associated with Libya's Muslim Brotherhood and other Islamist groups in Benghazi.
Calling the raid "Operation Libya's Dignity", he blamed them for the near constant bombings and assassinations that have plagued the east of the country in recent years.
The following day in Tripoli, forces from the town of Zintan allied with Gen Haftar and launched a brazen attack on the parliament building.
He framed the operation as an uprising against what he called the "Islamist-dominated" government of the time.
His criticism of the GNC will have chimed with many Libyans who are frustrated with the slow pace of political transition and the merry-go-round of prime ministers (of whom there have been three since March).
Now, Libya's embattled new parliament, the House of Representatives, has given Gen Haftar its backing. It says it will give its full support to anyone who helps "fight terrorism" in the country, although many argue it applies the term to political opponents as well as extremists.Libya's Sisi?
It is easy to see why some have compared Gen Haftar to Egypt's former military chief and now leader - President Abdul Fattah al-Sisi.
Both have vowed to rid their countries of the Muslim Brotherhood, and both have shown that they will not shy away from the use of considerable force to achieve this goal.
It is also increasingly clear that Gen Hafter is co-ordinating militarily with the Egyptian government. Air strikes in August and October on Islamist positions are widely believed to have been launched from Egypt.
While they may be ideologically close, there is one crucial difference - the military clout each can bring to bear.
Mr Sisi can rely on the unwavering support of Egypt's strongest institution - its armed forces - while Haftar is relying on a loose coalition of local militia and former army officers who are temporarily united against the current government.
As Mr Sisi did after ousting President Mohammed Morsi last July, Gen Haftar has denied harbouring any political ambitions.
But in light of recent events, it is wise to assume that he will continue to play a central role in Libya for the considerable future.