Libya has handed out more than $2 billion in loans to dozens of governments across the globe, according to an internal document that shows the oil exporter's diplomatic ambitions and its struggles to recover its debts.

Libya's foreign lending also shines a light on its attempts, before it emerged from decades of international isolation six years ago, to goad Washington by lending to U.S. foes such as Nicaragua, Cuba and the former Yugoslavia.

This was a period when ... (Libyan leader Muammar) Gaddafi was looking for anything that could upset the apple cart, said Dirk Vandewalle, a Libya scholar at Dartmouth College in the United States.

The document, drafted by Libya's foreign ministry and presented to the Peoples Congresses, or grassroots lawmaking bodies, says Libya has provided loans to around 40 countries worth a total of $2.197 billion.

As of the end of 2009, Libya had been paid back $1.302 billion, leaving an outstanding balance, when interest is included, of $3.231 billion, it said.

The biggest debtor mentioned in the document is Libya's neighbour Sudan with an outstanding balance of $1.287 billion, part of Sudan's debilitating external debt of almost $40 billion.

We are seeking to have (all of Sudan's) ... loans forgiven because we believe that both governments, the Government of Sudan and the would-be Government of South Sudan, would not be in a position to repay these loans in the near future, Marial Awour, the junior minister of finance, told Reuters.

Sudan's south is on course to secede from the mainly Muslim north after a referendum on independence.

Other big debtors are Ethiopia, which owes $249 million and Mozambique, with $211 million to pay back, according to a copy of the document obtained by Reuters.

Many of the loans are interest-free, especially those to African and Arab countries.

But much of the lending is further afield. The document, which does not detail when the loans were made, lists credit provided to Poland, Hungary, the former Yugoslavia, Pakistan, Cuba and Nicaragua, which now owes Libya $302.12 million.

That loan appears to date to the 1980s, when the South American country was run by the leftist Sandinista rebels who had fought U.S.-backed forces in a civil war.

My hunch is that this was purely to stab his (Gaddafi's) finger in the eye of the United States, supporting a country that was opposed to U.S. interests, said Vandewalle.

BAD DEBTS

Gaddafi has for decades challenged what he describes as U.S. imperialism. Until they were lifted in 2004, Libya spent years under international sanctions for seeking banned weapons and sponsoring militant groups.

The document is not dated but includes mentions of loan negotiations as late as last year. It reveals that Libya has often struggled to persuade its debtors to honour their repayment schedules.

It lists 15 countries which have paid back none of their loans and another 10 -- including Nicaragua and Cuba -- which it said started repaying the loans but then stopped.

Libyan officials sent messages to debtor nations reminding them that payments were overdue but often received no response, according to notes included in the document.

Some countries are struggling more than usual with external debt because of the impact of the global economic slowdown.

Libya offered suggestions to Niger on November 21 2008 on how it could pay its debt and Niger is still studying them, the document said. On Sudan's debt a meeting was held in 2009 and no agreement has yet been reached, it said.

The document said Libya threatened a third African country three years ago with legal action over late payments but since then there is no record of any payment having been made.

In at least one case, Libya's money appeared to have gone missing in mysterious circumstances.

A note on Yemen's debt said: There are no documents attesting that the Yemeni side received the first loan of $15 million, though the amount reached our brothers in Aden.