Just hours later, a suicide bombing killed five French troops in the country's east.
The Taliban claimed responsibility for both attacks. But Afghan officials cast doubt that the extremists were behind the killing of the president's brother. The gunman's motive remained unclear.
Shortly after the funeral, Karzai named another sibling, Shah Wali Karzai, to replace Wali Karzai. The move signaled the importance of continuity in a country where power vacuums are often filled with violent confrontations. Still, the new tribal elder is a relative unknown, and it was unclear if he will be as able an operator as Wali Karzai.
"The president will have to be very careful to move quickly to consolidate and maintain his power structure in Kandahar," said Rustam Shah, former Pakistan ambassador to Afghanistan.
Wali Karzai served as the enforcer of the government's tenuous rule over the ethnic Pashtuns, who also dominate the insurgency.
To the international community, he offered indispensable reach and ruthlessness, but he was also an embarrassment - a partner whose other partners were said to include opium dealers and smugglers. He denied those allegations.
Thousands of mourners gathered Wednesday morning in the Karzai family's home village of Karz. Pushing through a ring of his security men, Karzai climbed into his half-brother's freshly dug grave Wednesday and sobbed.
When the president's relatives and bodyguards urged him to come out, he refused. Finally, two pallbearers locked his arms under theirs and pulled him up.