Four years ago Hamid Karzai, the softly spoken, well-dressed president of Afghanistan, was untouchable. In the wake of the US-engineered toppling of the Taliban regime, Karzai was seen by the west as the only man who could make something out of a country wrecked by decades of war.

A Pashtun and a member of the same tribe as the old royal family, Karzai was thought to be cut from the right cloth to lead a famously fissiparous country. He was a man the west could do business with: although he initially backed the Taliban, he had shunned the extreme mujahideen groups that fought the Soviets in the 1980s and which gave rise to some of the militant groups causing havoc today.

With his impeccable English, Karzai wowed the international community, not least Tom Ford, then of Gucci, who famously said the president's get-up of robes and karakul sheepskin hat made him the "chic-est man on the planet".

Today, the Karzai backlash is in full swing, from the US and European leaders threatening to undermine his position to senior Afghan figures in Kabul. "He was never the right choice," Ashraf Ghani, a former finance minister, said. "I worked with him and never thought he should have been more than a junior minister."

Opinion is divided on when things started to go so wrong for the 51-year-old leader. Hedayat Amin Arsala, a former vice-president who is still a senior minister, said Karzai's original sin was to co-operate with the reviled warlords when he became leader of Afghanistan's interim government in early 2002. These regional militia leaders were revered as heroes of the jihad against the Soviet Union, but after the Russians left they became hate figures for lawlessness and corruption.

Arsala, a former close ally of Karzai, is one of about a dozen Afghan politicians planning to stand against him in the presidential election in August. Sitting in the magnificent surroundings of his office, where the Afghan cabinet used to meet in the nineteenth century, he said he was standing more in sorrow than anger.

"For the last three years we have had insecurity and corruption. Unless we change this direction substantially and very energetically under a new leader then I think we are going to be in trouble."

Blame

Karzai's defenders say it is unfair to blame all of Afghanistan's current troubles on a single individual who was denied the resources he needed from the start. "In the early days the international community did not have any coherent strategy and the question of governance was never raised," said Jawed Ludin, Afghanistan's ambassador to Norway and Karzai's former chief of staff.

"In the beginning Donald Rumsfeld barged in with a purely military strategy. They did nothing to stop drug production and they hired militias who perpetuated a lot of atrocities."

But it is hard to find anyone who can explain Karzai's apparent inability to crack down on the rampant corruption that is eating at the heart of the Afghan state. According to Transparency International's corruption index, Afghanistan slipped from being perceived as the 117th least corrupt government in the world in 2005 to 176th in 2008 - four places from the absolute bottom.

Last year Thomas Schweich, one of George Bush's top counter-narcotics officials, accused Karzai himself of trying to thwart US efforts to crack down on poppy cultivation and "protecting drug lords and narco-farmers" involved in the £2.8bn a year industry.

Rumours have abounded for years about some of Karzai's brothers, most notably Ahmed Wali Karzai, the head of the provincial council in Kandahar. Last year the New York Times quoted White House officials saying Ahmed Wali was involved in drug trafficking - an allegation he denies.

More recently, public attention has focused on Mahmoud Karzai, a man who spent most of his life in political exile in the US running restaurants. Despite his relatively limited business experience, in the last seven years he has become one of Afghanistan's leading tycoons, with shares in the country's biggest bank, property developments, and control of one of the country's biggest industrial assets, a cement plant north of Kabul.

Mismanagement

Some close observers say the president is just too nice to get to grips with the cronies that surround him. "The trouble is he doesn't like confronting people or saying things to people that they don't want to hear," said Francesc Vendrell, the former European Union special representative in Kabul, who first met Karzai in 2000.

"It was a constant battle to persuade him to get rid of ministers or governors who were corrupt or incompetent."

In the view of one western diplomat: "He's a poet for Christ's sake - what do you expect?" Karzai was once found by a western diplomat poring over a collection of Philip Larkin poems. Some credit his poetry as the source of ability to hold an audience, whether in English, Dari or Pashtu. But many technocrats who plan to stand against him in August say his pre-2001 career as a junior official in a moderate anti-Soviet resistance group did not give him the management skills necessary to run a modern state.

"Unlike his brothers he couldn't even run a two-room restaurant," said Ashraf Ghani, who once served as Karzai's finance minister and is running against him.

Anwar ul-Haq Ahadi, another former finance minister and presidential candidate, said Karzai had "absolutely no capacity for critical thinking".

"He does not prepare for meetings. He does not do background reading, he does not prepare questions. Cabinet meetings are very unproductive. He just takes a position and then expects it to be followed."

One of Karzai's aides, speaking privately, said the presidential office was chaotic, with minutes of meetings rarely kept and copies of presidential speeches lost. Decisions are made "on the hoof" with an inner circle of "yes men".

Mohammad Amin Farhang, who until late last year was commerce minister, said the president often appoints unsuitable provincial governors and government officials to retain the support of warlords.

"Without asking me he appointed a department head in my ministry who was totally incompetent. It was a political deal between [Karzai] and a jihadi leader and it created lots of problems."

Helena Malikyar first met him in the late 1990s at meetings held in Rome by exiled Afghan politicians.

"He never really took the lead and would be very quiet for long periods. Whenever there was a suggestion with which he disagreed he wouldn't say anything to counter it," she recalled.

The president's shortcomings have not been helped by the wall of security surrounding the presidential palace in Kabul, largely shutting him off from the realities of Afghan daily life.

Dr Abdullah Abdullah, a former foreign minister and another candidate, said: "With all the ceremonies, protocol and troops marching around, he soon was not walking on the ground. Gradually he came to view that he deserved it, and he was the only person who could run the country."

A common analysis of Karzai's management style is that of a traditional tribal elder who, according to a western diplomat, "wants to satisfy everyone. They don't want to alienate anyone because this is the tradition of tribal jirgas."

But Ahmed Wali Massoud, a former senior member of Karzai's early government and brother of the current vice-president, does not accept the analysis. "Tribal leaders keep promises. They promote the interests of the tribe, but Karzai does it for his own ego."

Massoud believes Karzai is a man who has taken too many lessons in statecraft from the British colonial experience.

"He once said to me, 'The only way to rule this country is divide and rule! Divide and rule!' He repeated it over and over."

Washington

Abdullah said Karzai had used this ploy by warning that if the US failed to provide military aircraft, he would seek assistance from "the other place", which was widely interpreted as meaning Russia.

It is the increasingly negative view from Washington that is most dangerous for Karzai's political survival. "Most Afghans are extremely pragmatic and they equate foreign support with strength," said Ludin, the ambassador to Norway. "If they know the Americans are not with you, you are not a serious candidate."

Karzai's all-important relationship with the Democrat leadership in Washington turned sour long before Barack Obama was elected. In February 2008 Joseph Biden, then a senator, paid a visit to Kabul. Over a meal at the palace, Biden grew increasingly exasperated at Karzai's refusal to accept that his government was mired in corruption. The future US vice-president eventually stalked out early, declaring: "This meeting is over."

Obama did not even bother to phone his opposite number until four weeks after his inauguration, and cancelled the regular video conferences that Bush was fond of having with Karzai.

The two leaders reportedly got on well, partly because they had the same "gutsy, informal way of doing business", according to Ludin, who recalled Karzai's habit of jumping up in meetings to pour cups of tea for even the most junior officials. Bush also "didn't want to admit they had a problem in Afghanistan, when things were going so wrong in Iraq", according to one US diplomat.

Now Karzai has to deal with Richard Holbrooke, Obama's special envoy tasked with turning around the unfolding crises in Afghanistan and Pakistan. Holbrooke clearly thinks Karzai is part of the problem. In remarks made before his appointment he said his government was "weak; it is corrupt; it has a very thin leadership veneer; it is internally divided; it has never arrested any major drug lords".

But it is on the issue of civilian casualties that Karzai's relationship with his western backers has hit rock bottom. In September he had a furious row with the normally supportive Bush administration after he accused US forces of massacring more than 90 civilians, including women and children, in Azizabad. According to one of Karzai's close aides, Condoleezza Rice gave Karzai a verbal lashing over the incident during a telephone conversation. She warned the president that if he continued to criticise the US, "we will no longer co-operate with you".

Karzai says he has lost popularity in Washington because of his willingness to talk out on the issue. "I was a lovely man when I was keeping quiet. I'm a nasty man, a no-good leader when I began to speak," he complained recently.

Holding on

Other observers say Karzai is warning the US to back off. One of his top aides warned the recently departed UK ambassador of the dangers of not supporting Karzai, only for him to win anyway.

And that, despite his unpopularity, still looks like the most likely outcome. Karzai enjoys both the advantages of incumbency and a face recognised across the country in an election where most voters are unable to read names on the ballot. And as long as he remains president, he has the power to reward supporters with government positions who can be expected to campaign for him in far-flung parts of the country. The opposition can only cash in on the national ill-will towards the president if most of them agree not to stand so the anti-Karzai vote would not be split.

"There are no other candidates who are obviously better," one western diplomat said. "Some might be better administrators but they probably won't be better communicators."

Haroun Mir, director of the Centre for Research and Policy Studies in Kabul, fears the international community will give up on Afghanistan unless things change. "With President Karzai we cannot hope for change: it will be another five years of nepotism, corruption and mismanagement of funds and dysfunctional government."

Performance issues

The president of Afghanistan is known for making maximum use of his far-reaching executive powers.

To the frustration of western diplomats, Hamid Karzai is in the habit of getting involved in the appointment of junior officials and relatively lowly governors of some of the country's 360 or so districts, rather than spending his time on bigger issues. But while Afghanistan's highly centralised system allows for presidential micro-management it is not very good at delivering services to ordinary Afghans.

Resource-starved ministries in Kabul and a lack of qualified bureaucrats can prevent projects in far-flung parts of the country ever getting off the ground. The president's powers in relation to parliament have never been settled and Karzai has had several battles with the country's elected politicians.

Yunus Qanooni, the speaker of parliament's lower house, has led calls for the constitution to be changed to create a strong prime ministerial role with executive powers.

• This article was amended on Thursday 26 March 2009. Afghanistan was perceived as the 176th least corrupt, rather than most corrupt, government in the world last year. Transparency International's perceived corruption index ranks countries with the cleanest at the top. Afghanistan was four places from the bottom. This has been corrected.