Chanting "death to the Taliban" and "death to America," the protesters carried six coffins, cloaked in Iran's red, white and green flag, to Tehran University for the Friday prayer ceremony.
The coffins contained the bodies of five diplomats and an Iranian journalist killed when Taliban militiamen stormed the Iranian consulate in the northern Afghan city of Mazar-e-Sharif last month.
Iran's supreme leader, Ayatollah Ali Khamenei, took part in the procession. The crowd urged him to declare "jihad," or holy war, on the Taliban Islamic army, which controls 90 percent of Afghanistan.
Khamenei did not speak during the funeral.
Demonstrations against the Taliban were also held in the cities of Mashhad, Arak, and Tabriz, the official Islamic Republic News Agency reported.
The killings have brought to a head simmering tension between Iran and the Taliban. Iran has since massed tens of thousands of troops on its border with Afghanistan, and Khamenei has put the military on full alert.
Hardline leaders in both countries, Iran and Afghanistan, seem determined to take the two Muslim fundamentalist regimes to war.
Taliban leaders say they have rushed troops to the border region to repulse any Iranian attack. Their spokesman warned that any confrontation could touch off a wider conflict.
"I do believe that it will not be only Afghanistan," said Noorullah Zadran. "I think the regional countries would certainly be involved and the matter could easily get out of hand."
The Taliban admitted Sept. 10 to killing eight diplomats and a journalist for the Islamic Republic News Agency after its forces captured Mazar-e-Sharif on Aug. 8.
The Taliban returned seven of the nine bodies to Tehran on Monday. Iranian radio reported Friday that the Foreign Ministry could not identify the body of one diplomat and had asked the International Committee of the Red Cross to help.
The coffins were taken Friday to the sprawling cemetery of Behesht-e-Zahra, south Tehran, and buried near the tomb of Ayatollah Ruhollah Khomeini, who led Iran's 1979 Islamic revolution.
Diplomatic efforts to ease the tensions continued Friday, as the Taleban's supreme ruler Mullah Mohammad Omar called on the United Nations to resolve the crisis.
U.S. officials said on Thursday that Iranian Foreign Minister Kamal Kharrazi would take part in an eight-nation meeting at the U.N. next Monday to discuss the situation in Afghanistan. The Taleban was not due to attend the meeting.
If the meeting goes ahead as planned, it will mark the highest level contacts between U.S. and Iranian officials in many years. However, Iranian officials emphasized that no bilateral talks with the U.S. are planned.
©1998 CBS Worldwide Corp. All rights reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press and Reuters contributed to this report