Police said the 15-year-old boys were snapping selfies at a flooded road in the northern town of Melandah on Wednesday when they were swept away by powerful currents.
"With the school shut down due to floods, and the road underwater, they thought it was good idea to take selfies on the flooded road," said Mohan Talukder, the headmaster of Umir Uddin School where the boys attended.
"Unfortunately huge currents washed both of them into a roadside flood-plain. Several villagers tried to save them, but one of them was also washed away by floodwaters."
Local police chief Mazharul Karim told AFP their bodies were recovered by divers after a day-long search.
Nearly half of Bangladesh is affected by the floods but the government's weather agency has warned the worst could be yet to come, with two major rivers at bursting point.
"The flood situation in the country's central region could worsen in the next few days," said Sazzad Hossain, head of the Flood Forecasting and Warning Centre.
Bangladesh's health department said coupled with those killed in separate flooding in July, at least 107 people had perished amid monsoon downpours.
The floods have destroyed nearly 200,000 houses and wiped out crops on nearly 580,000 hectares (1.4 million acres) of land, officials said.
The government has opened close to 1,500 shelters where food and supplies are available, but those in hard-hit areas have complained that aid had not yet reached their villages.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)