Rabbi Ovadia Yosef, 93, wielded enormous influence among Israeli Jews of Middle Eastern and North African ancestry but courted controversy with his outspoken views.
He had been in and out of hospital for months and undergone heart surgery, before dying in hospital yesterday.
The mourners, mostly ultra-Orthodox Jews and with men separated from women, gathered outside Yosef's seminary, before heading to his burial in Jerusalem's conservative Sanhedria district.
"We estimate there are more (than) 7,00,000 people taking part in the largest of funerals ever in Israel," police spokesman Micky Rosenfeld wrote on Twitter.
More From This Section
Police deployed in their thousands, blocking off some of the Holy City's roads. The emergency services said the overcrowding injured some 300 people.
"I've been crying since I heard the news," said Aviel Mor, a 24-year-old yeshiva religious seminary student, who like hundreds of others tore the lapel of his shirt in the Jewish tradition of mourning for immediate family members.
The rabbi's death came after he had heart surgery at Hadassa hospital, where he eventually passed away.
Peres later delivered a eulogy for "my teacher, my rabbi, my friend".
"I held his hand which was still warm and kissed his forehead. When I pressed his hand I felt I was touching history and when I kissed his head it was as though I kissed the very greatness of Israel," he said of his earlier meeting with the rabbi.
Yosef, a former Sephardic chief rabbi of Israel whose son took over the same role in June, had frequently played the role of kingmaker in the country's fickle coalition politics.
Prime Minister Benjamin Netanyahu said Jews had lost "one of the wisest men of this generation".
Yosef founded Shas in 1984 on the platform of a return to religion and as a counter to an establishment dominated by Ashkenazi Jews of European ancestry.
But the Baghdad-born rabbi frequently courted controversy with his outspoken remarks, describing Palestinians and other Arabs as "snakes" and "vipers" who were "swarming like ants".
He called on God to strike down then premier Ariel Sharon over Israel's 2005 withdrawal from Gaza, and during the 2006 war in Lebanon, he implied Israeli soldiers killed in battle died because they didn't follow Jewish commandments.