Agitated locals beat the workers to death on allegations of setting fire to a temple
He received a guard of honour from the President's Guard Regiment before leaving on a special flight from the Hazrat Shahjalal International Airport at 2:45 pm on Friday.
Prime Minister Sheikh Hasina gave him a warm farewell with a bouquet.
President Mahmoud arrived in Dhaka on Wednesday on his first official trip to Bangladesh.
Later he sat with his Bangladeshi counterpart Md Abdul Hamid and the prime minister in separate meetings where both the Bangladeshi leaders voiced their support for Palestine.
The meeting was followed by a dinner at the president's official residence Bangabhaban.