The World Muslim Congregation, Biswa Ijtema, the world's biggest annual Islamic event after the Hajj pilgrimage to Makka in Saudi Arabia, was due to end on Sunday in Dhaka.
At the 41st such meeting since 1946, Muslims gathered from more than 80 countries to listen to sermons in at least 10 languages, and more than 100 couples were married in a mass wedding ceremony.
Jahirul Islam, of the event's organising committee, said: "We estimate that four million people have attended over the three days including 101 couples who married without dowry in accordance with the rules of Islam."
Dowry payments or gifts, customarily given by a bride's family to the groom, are officially banned in Bangladesh.
But the tradition remains widely practised. Disputes over dowry are frequently cited as triggers for violence against women including acid attacks that often disfigure victims for life.
The wedding ceremony on Saturday was attended by only the grooms and the brides' guardians who had arranged the matches. Arranged marriages are common in Bangladesh.
Islam said: "For the next few weeks at least the grooms will be taught by their religious leaders how to lead a good conjugal life according to Islamic law. Then they will meet their brides for the first time."
Food is prepared to be shared
out at the gathering
This year's Biswa Ijtema was held in an atmosphere of tight security after a number of blasts and attacks linked to a banned Islamic group, Jamayetul Mujahideen Bangladesh, which wants Islamic law established in the Muslim country.
About 22,000 troops including members of the elite Rapid Action Battalion were deployed at the festival.
At least 28 people including four bombers have been killed in the attacks since August.
The Biswa Ijtema is organised by Tabligh Jamaat, a group launched four decades ago in New Delhi to encourage Muslims to follow Islamic tenets in their daily lives.
Secular Bangladesh, a nation of 140 million people, is the world's third largest Muslim-majority country.