Image caption Peter Doyle claims there was a "fundamental illegitimacy" in Christine Lagarde's appointment

A top economist at the International Monetary Fund has poured scorn on its "tainted" leadership and said he is "ashamed" to have worked there.

Peter Doyle said in a letter to the IMF executive board that he wanted to explain his resignation after 20 years.

He writes of "incompetence", "failings" and "disastrous" appointments for the IMF's managing director, stretching back 10 years.

No one from the Washington-based IMF was immediately available for comment.

Mr Doyle, former adviser to the IMF's European Department, which is running the bailout programmes for Greece, Portugal and Ireland, said the Fund's delay in warning about the urgency of the global financial crisis was a failure of the "first order".

Analysis Peter Doyle's letter is short but the criticism excoriating. Perhaps the bigger of the two main charges is that the IMF failed to warn enough about the problems that led to the global financial crises. The IMF has had investigations which have, up to a point, made similar criticisms, but not in such inflammatory terms. The IMF did issue some warnings, but the allegation that they were not sustained or timely enough and were actively suppressed raises some very big questions about the IMF's role. Then there is the description of the managing director as tainted. It's not personal. It's a familiar attack on a process which always selects a European. It's still striking, though, to hear it from someone so recently on the inside.

In the letter, dated 18 June and obtained by the US broadcaster CNN, Mr Doyle said the failings of IMF surveillance of the financial crisis "are, if anything, becoming more deeply entrenched".

He writes: "This fact is most clear in regard to appointments for managing director which, over the past decade, have all-too-evidently been disastrous.

"Even the current incumbent [Christine Lagarde] is tainted, as neither her gender, integrity, or elan can make up for the fundamental illegitimacy of the selection process."

Mr Doyle is thought to be echoing here widespread criticism that the head of the IMF is always a European, while the World Bank chief is always a US appointee.

Mr Doyle concludes his letter: "There are good salty people here. But this one is moving on. You might want to take care not to lose the others."

The IMF could not be reached immediately by the BBC. However, CNN reported that a Fund spokesman told it that there was nothing to substantiate Mr Doyle's claims and that the IMF had held its own investigations into surveillance of the financial crisis.