"Death to America! Death to Pakistan! Death to Karzai!" the crowd shouted before being dispersed by guards who fired warning shots into the air. Other slogans referred to conspiracy theories relating to Rabbani’s assassination.
The former president, whom President Hamid Karzai had appointed head of the High Peace Council, was assassinated on Tuesday by a suicide bomber who had promised to help negotiate with Taliban insurgents.
Thousands of police and secret service agents were on the highest state of alert to prevent Taliban attacks after the assassination and the attack on the US embassy last week.
Karzai has said the assassin gained access to him by bringing a CD with an apparent "message of peace" from the Taliban.
The Taliban have refrained from commenting on the killing, despite an early claim on their behalf. The Afghan secret services says it believes that the Taliban leadership body, the Quetta Shura, was involved.
The president, who did not attend the burial but was at a tribute at the presidential palace, pledged to press on with attempts to reach a peace bid with the insurgents, whom he referred to as “deceived sons of the country”.
But the killing has undermined support for the plan, especially among Rabbani’s Tajik ethnic group.