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. (Read statement issued by Rashtrapati Bhavan on the incident)
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.
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."
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.