The president, in a condolence message, prayed for the departed souls and expressed sympathy for their families, his Press Secretary Joynal Abedin told bdnews24.com on Thursday.
He also wished an early recovery of those injured, Abedin said.
Prime Minister Hasina, too, in her message, prayed for the departed souls and conveyed her deep sympathies to the bereaved families, her Deputy Press Secretary Ashraful Alam said.
The stampede, one of the worst in the history of Hajj, has left at least 717 people dead and 863 injured at a time when Saudi Arabia is celebrating Eid-ul-Azha.
There has been no report of any Bangladeshi being killed in the stampede.