Backed by the United States, Hamid Karzai overwhelmingly won 18 more months as leader of Afghanistan's fledgling government Thursday, swept into the presidency by an extraordinary grand council of 1,650 Afghans taking tentative steps toward a fragile democracy.

Delegates from across the nation applauded thunderously as the decision was announced three hours after they voted in a secret ballot -- the first time in a generation that Afghans have elected their leader. Many said they were applauding not just for Karzai but for a resurgent Afghanistan.

"You trusted me," a beaming Karzai said, removing his hat and bowing slightly to the crowd as it surged forward. "God will help us rebuild Afghanistan again."

The 44-year-old chairman of the current interim government won 1,295 votes from delegates to the grand council, the loya jirga. Masooda Jalal, a female employee of the World Food program, won 171 votes and Mir Mohammed Mahfoz Nadai took 89. The United Nations said 1,575 votes were cast and that 20 were declared invalid.

The election of a new president -- and the loya jirga itself, a modern incarnation of a centuries-old Afghan tradition -- represents the midpoint of a U.N. blueprint to help set Afghanistan on its way after 23 years of war. The next steps, a constitution and free elections, will come at the end of Karzai's transitional administration.

"We're halfway," said Lakhdar Brahimi, the U.N. special envoy. "The president has been chosen by a reasonably representative sample of the people of Afghanistan. They've done it the way they want it. That's the most important thing."

In Washington, State Department spokesman Philip Reeker congratulated Karzai and welcomed the "lively debate and discussion" in the loya jirga on establishing new institutions. He described the sessions as "an important step in the reconstruction of the country and the establishment of self government."

In a statement, U.N. Secretary-General Kofi Annan also welcomed Karzi's election and "the enthusiastic embrace" of the Loya Jirga's democratic process by the Afghan people. He urged delegates to use the meeting "to pursue national reconciliation and to create a representative government.

During the monthlong run-up to the loya jirga -- a two-step process of naming a pool of local hopefuls and then culling actual delegates -- reports came in from many regions of bribery, intimidation and harassment.

Yet Afghan after Afghan has said the process, while not perfect, outshines anything they've had in years. Even those lukewarm about Karzai -- whose silken demeanor, easy manner and personal style makes him the perfect Afghan leader for a Western audience -- say he embodies their sense of hope.

"He's been given a mandate to lead," Karzai aide Ashraf Ghani said. "Afghanistan is a legitimate government now. After years of being denied a role in choosing our leaders, we have freely chosen."

The long day revealed a process, at times chaotic and unwieldy, that represented the first real stab at democracy for a country emerging from two decades of war and poverty. Men jockeyed for microphones. One woman, giving an impassioned speech, was cut off when loya jirga Chairman Ismail Qasim Yar ordered her microphone muzzled.

Across the huge, air conditioned tent where the meeting is taking place, people sat on the floor near the 16 voting booths waiting to get their ballots. A few, with camcorders, filmed the tableau.

The gathering was a historic moment for many -- and a snapshot of Afghan diversity, as participants clad in shalwar kameez and turbans mingled with those in immaculate business suits.

"This feels like democracy. Maybe it isn't yet. But we're getting there," Abdullah, a delegate from Kunduz in the northeast, said after casting his ballot.

President Bush's special envoy, Zalmay Khalilzad, hailed the election of Karzai, whom the United States had promoted since the final weeks of the air war against the Taliban last year.

"It's a great day for Afghanistan -- electing a government rather than a government through coups, military intervention or violence," Khalilzad said. Some delegates have criticized the United States, both overtly and obliquely, for exerting pressure on the process to ensure Karzai's election.

Voting by secret ballot -- with black-and-white photos of the candidates adjacent to their names -- extended into the evening.

Karzai, praised for his reconciliation efforts during six months in power, became a sure bet to win after his two major opponents -- former king Mohammad Zaher Shah and one-time President Burhanuddin Rabbani -- withdrew from the race.

"The king is very happy. There was never any thought that the king wanted a political role. He is above politics, separate from it," said Hamid Nasir Zia, an aide to the former monarch.

Karzai made a call for national reconciliation, even with some members of the deposed Taliban, who he said were "hijacked by the foreign people" -- Arabs from Al Qaeda who came to dominate the regime. He promised a brighter future if the country's 27 million people can put aside ethnic differences.

Three other candidates had been nominated, although one was disqualified for lack of support.

Jalal, a female employee of the World Food program, addressed the delegates and called herself a simple Afghan woman with no links to any armed group.

"I thank God that after so many difficulties, the sun is rising over our country," Jalal said. Her candidacy reflected the demands of women for a voice in public affairs after years of discrimination by the Taliban.

The Taliban as well as foreign fighters -- including those affiliated with Usama bin Laden's Al Qaeda network -- were ousted in a U.S.-led military campaign that followed the Sept. 11 attacks. The Taliban's departure was greeted with a massive international effort to help rebuild Afghanistan.

Many delegates criticized the presence of warlords and former commanders at the loya jirga. Once hailed as heroes, they are now reviled for having plunged the country into more strife after they drove out Soviet invaders in 1989 and the pro-Moscow government in 1992.

But most delegates wanted to look ahead -- to the loya jirga's work of fashioning the rest of the transitional government and to the possibilities of a Karzai administration with authority across the land.

"I want him to work hard for Afghanistan and rehabilitate it," said Juma Gul, a Pashtun delegate from Helmand province in the south.

"The country is destroyed. My three brothers are martyred," he said. "People have suffered so much. We want him to fix the country. He needs to open his ears and listen to the cries of the nation."