Statements from the White House, including from the president, in support of Afghanistan were resolute, but behind them was a halting, sometimes reluctant commitment to solving Afghanistan’s myriad problems, according to dozens of interviews in the United States, at NATO headquarters in Brussels and in Kabul, the Afghan capital.

At critical moments in the fight for Afghanistan, the Bush administration diverted scarce intelligence and reconstruction resources to Iraq, including elite C.I.A. teams and Special Forces units involved in the search for terrorists. As sophisticated Predator spy planes rolled off assembly lines in the United States, they were shipped to Iraq, undercutting the search for Taliban and terrorist leaders, according to senior military and intelligence officials.

As defense secretary, Donald H. Rumsfeld claimed credit for toppling the Taliban with light, fast forces. But in a move that foreshadowed America’s trouble in Iraq, he failed to anticipate the need for more forces after the old government was gone, and blocked an early proposal from Colin L. Powell, then the secretary of state, and Mr. Karzai, the administration’s handpicked president, for a large international force. As the situation deteriorated, Mr. Rumsfeld and other administration officials reversed course and cajoled European allies into sending troops.

When it came to reconstruction, big goals were announced, big projects identified. Yet in the year Mr. Bush promised a “Marshall Plan” for Afghanistan, the country received less assistance per capita than did postconflict Bosnia and Kosovo, or even desperately poor Haiti, according to a RAND Corporation study. Washington has spent an average of $3.4 billion a year reconstructing Afghanistan, less than half of what it has spent in Iraq, according to the Congressional Research Service.

The White House contends that the troop level in Afghanistan was increased when needed and that it now stands at 23,500. But a senior American commander said that even as the military force grew last year, he was surprised to discover that “I could count on the fingers of one or two hands the number of U.S. government agricultural experts” in Afghanistan, where 80 percent of the economy is agricultural. A $300 million project authorized by Congress for small businesses was never financed.

Underlying many of the decisions, officials say, was a misapprehension about what Americans would find on the ground in Afghanistan. “The perception was that Afghans hated foreigners and that the Iraqis would welcome us,” said James Dobbins, the administration’s former special envoy for Afghanistan. “The reverse turned out to be the case.”

Secretary of State Condoleezza Rice defended the administration’s policy, saying, “I don’t buy the argument that Afghanistan was starved of resources.” Yet she said: “I don’t think the U.S. government had what it needed for reconstructing a country. We did it ad hoc in the Balkans, and then in Afghanistan, and then in Iraq.”