Under clear desert skies and a sweltering sun, a team of CIA trainers put the Libyan exile commander through his paces, teaching sabotage and tactics to his small band of fighters. Back then, in the 1980s, they dreamed of the day they could go home and topple Muammar Gaddafi.
Khalifa Haftar's offensive against the government that replaced Gaddafi – which he accuses of being a haven for terrorists – has been far more successful. He has attacked Islamist militias in Benghazi and the parliament in Tripoli. In less than a week, key army units, political parties and tribal forces have rallied to his banner. On Thursday tension mounted when a powerful brigade from Misrata deployed in the centre of the capital. The renegade general's moves are being closely watched both at home and abroad.
Haftar's old links with the CIA have come back to haunt him, with enemies denouncing him as an American "agent". In Libya's charged political mood, the charge is toxic but it may be misleading or simply old news. For the record the US has denied backing him; he has also denied being in contact with Washington.
Haftar set out on the road to power as a twentysomething soldier in another coup – led by his fellow officer Gaddafi against King Idris in 1969. Like Gaddafi, Haftar is of Bedouin stock, and he believed the army would be Libya's salvation. But the country plunged into dictatorship and war when Gaddafi invaded his southern neighbour Chad.
Gaddafi's "Toyota war" ended in disaster. In September 1987 a Chadian force, aided by French and US intelligence, launched a stunning night attack on Libya's southern airbase, killing 1,700 troops and taking 300 prisoners, among them their commander, Haftar.
In captivity in Chad, disowned by Gaddafi, an angry Haftar accepted an American offer of freedom in return for defecting and joining an exile brigade, the Libyan National Army. "Haftar was an experienced soldier and it was a very big deal for us when he came over," recalled Ashour Shamis, then a member of the anti-Gaddafi opposition.
The programme that followed was standard fare for a CIA busy training exiles to fight America's enemies. Gaddafi – supporter of international terrorism – was a high priority for the Reagan administration. In 1986 Libyan agents bombed a Berlin disco, killing off-duty US soldiers. US jets bombed Gaddafi's Tripoli home. Smarting from the attack, and blaming Paris and Washington for his failure in Chad, Gaddafi reportedly authorised the bombing of a Pan Am flight over Lockerbie in 1988 and a French airliner over Niger the following year. Later, Haftar and his men had to leave Chad after a pro-Libyan coup and ended up in the US. Haftar set up home in Virginia, a stone's throw from CIA headquarters in Langley.
But by then his star was fading. With the end of the Cold War Libya lost its strategic importance and the CIA cut funding for Haftar's brigade. Eventually Haftar broke with the opposition and mended his fences with Gaddafi, though he never returned to Libya. Tony Blair's famous meeting in the desert with Gaddafi in 2004 symbolised the pariah's return to international respectability. Exile armies became a thing of the past.
Haftar went back to Benghazi when the Libyan uprising began in 2011, without US help. Britain, France and the Gulf states sent trainers and special forces to support the Nato bombing, while the Obama administration kept its distance. Haftar was relegated to number two behind Gaddafi's former intelligence chief, Abdel Fatah Younis. "Khalifa felt he had been jilted in not getting a senior military position," an acquaintance said. "The [rebel] national transitional council didn't want him because he was tainted by contacts with Gaddafi."
Still, his reputation for strong leadership served him well as the first post-Gaddafi government lurched from crisis to crisis. From the eastern town of Bayda, Haftar gathered support as Islamists took control of parliament and army commanders complained of the growing strength of independent militias. The US was furious after the state-funded Ansar al Sharia stormed its consulate in Benghazi and killed ambassador Chris Stevens.
In February Haftar put his head above the parapet with a televised speech denouncing the government and announcing its overthrow. The dramatic appeal failed to spark an uprising but it marked Haftar out as the figurehead for opposition.
Critics compare him to Egypt's army commander, Abdel-Fatah al-Sisi, who overthrew the democratically-elected Muslim Brotherhood president Mohamed Morsi last year and is now poised to be elected president himself. Haftar, like Sisi, is said to have the enthusiastic backing of the fiercely anti-Islamist United Arab Emirates, as does his ally, the former prime minister Mahmoud Jibril. Haftar even created a Supreme Council of the Armed Forces - the very same name used by the Egyptian military.
But direct comparisons are not helpful. Libya's armed forces are nothing like as strong as their mighty Egyptian counterparts. "No one is fooled when Haftar says he is leading the national army," says Jason Pack of Libya-analysis.com. "That's just another militia."
Haftar's momentum could change that. His Operation Karama ("dignity") has led army units, tribes and the largest non-Islamist party, the National Forces Alliance, to declare their allegiance. But victory is far from certain – and the risks are considerable.
"Haftar's initiative is responding to a deeply felt need," said Libya expert George Joffe. "Even if he is not the man of the moment, he might appeal to a popular mood that will allow him to carry on. The danger is that it will collapse into civil war."
Among those who know Haftar well is Mary Beth Long, head of a group of US companies lobbying a sceptical Congress to sell weapons to Libya. Long headed CIA operations when Haftar was still in Virginia. Later appointed Donald Rumsfeld's assistant secretary of state, she was Middle East adviser for Mitt Romney's 2012 election campaign. Until Haftar's successes, the Obama administration had been worried by the growing power of jihadist groups and feared that US weapons could fall into their hands, although in January Congress authorised a $600m programme to support training for 6,000 Libyan soldiers. The only sizeable defence sale to date, of 347 Humvee personnel carriers, went wrong when some ended up with Ansar al-Sharia.
Attitudes on Capitol Hill may change if Haftar succeeds in defeating Libya's Islamists. The US will be monitoring events closely – though for the moment, its embassy in Tripoli is working to keep channels open to the Muslim Brotherhood. "I don't think something like this can happen in Libya and the Americans would not know about it," said Shamis. "I think they want to see how much momentum Haftar has and how far he goes."