Qanuni, an ethnic Tajik who came a distant second to Karzai in presidential elections last year, was chosen on Wednesday to lead the 249-seat lower house of parliament with 122 votes against 117 for Abdul Rabb Rasoul Sayyaf, his closest challenger.
Qanuni is from the Panjshir Valley, the heart of opposition to Soviet occupation in the 1980s and Taliban rule in the 1990s.
He was a senior leader of the Northern Alliance that helped US-led forces topple the Taliban in 2001 and became interior minister in Karzai's interim government.
Relations cooled when Karzai demoted him to education minister in 2002 and he resigned after announcing his candidacy for the presidential election in October last year.
Qanuni has tried to form an opposition bloc called the Understanding Front and warned before the election that he might not support all of Karzai's cabinet choices, which have to be endorsed by parliament.
Tuesday's first full session of the lower house saw emotional exchanges between rights activists and former factional commanders from Afghanistan's long civil war.
Malalai Joya, a woman MP who is an outspoken critic of former regional commanders who secured assembly seats and has vowed to take them on, was shouted down when she tried to read a statement in that session.
Qanuni, an ethnic Tajik, was a
senior Northern Alliance leader
Meanwhile, President Karzai has said he is unworried by US plans to cut troop numbers in Afghanistan, and Donald Rumsfeld, the US defence secretary, has played down concerns about Nato states' willingness to fill the gap.
Under pressure to cut US troop commitments overseas in the face of difficulties in Iraq, Rumsfeld on Monday ordered a reduction in the number of American troops in Afghanistan to about 16,500 from the current 19,000 by next spring.
The first such cut since US forces invaded Afghanistan in 2001 to oust the Taliban was made possible by a planned increase in Nato peacekeepers there next year and the growing size of Afghan security forces, Rumsfeld and defence officials said.
"Afghanistan has the total assurance of the United States that it will remain committed in helping in all spheres of life, including in the matter related to security," Karzai said on Wednesday after a meeting Rumsfeld in Kabul.
"The reduction does not mean a reduction in the actual force that one would need to combat terrorism.
Rumsfeld assured Karzai in Kabul
of continued US military support
"We are assured of the continued United States' support, so I don't think it will have an impact on the situation on the ground."
Asked how confident he was about Nato states filling the gap, Rumsfeld made reference to questions in the Dutch parliament.
"The fact that one country is having questions in its parliament really ought not to affect anyone's judgment about the commitment of Nato overall," he said.
On Tuesday, three Italian peacekeepers were slightly hurt in a car-bomb attack in the western city of Herat. A similar attack on Norwegian peacekeepers in Kabul last Friday slightly wounded two passers-by