The Indian president landed in Dhaka on Sunday.
The president was in his suite at the posh Hotel Sonargaon when the explosion took place nearly half a kilometre away, Deputy High Commissioner Sandeep Chakravarty said to NDTV.
Mr Chakravarty added that the explosion was part of the protest that have become a near-daily feature in Dhaka, was caused “by a harmless device” and that the president was in no way the target.
The country has been tense since the leader of an Islamist party was sentenced to death for crimes including mass murder and rape during the 1971 war of independence from Pakistan.
Over 70 people have been killed in clashes in recent days, the worst in the country’s history since independence. On Thursday, the Jamaat-e-Islami’s Delwar Hossain Sayedee became the third Islamist to be sentenced by a domestic tribunal.
Jamaat says the process is an attempt by the ruling party to settle scores and not about delivering justice.
Thousands of students have organised the Shahbagh movement, named for a neighbourhood in Dhaka. Using Facebook, Twitter and blogging forums, the protests have galvanised mass support to demand death penalty for those guilty of war crimes, mostly Jamaat activists.
President Mukherjee, addressing a convocation ceremony at Dhaka University, said this morning to students, “The future of Bangladesh is in your hands. You should know that you have a past which is steeped in glory, and a future that is full of promise. I have been deeply impressed by the maturity, awareness and involvement of the youth of Bangladesh in the task of nation building.”