Kunio Hoshi, 65, was gunned down by militants from Jamayetul Mujahideen Bangladesh, a group that has pledged allegiance to Daesh.
A court in Bangladesh on Tuesday sentenced five militants to death for killing a Japanese farmer in a drive-by shooting in October 2015.
Kunio Hoshi, 65, was gunned down by Jamayetul Mujahideen Bangladesh (JMB) militants while on his way to visit a grass farm project in the northern district of Rangpur.
A judge in Rangpur found the five defendants guilty of murder and sentenced them to hang.
Judge Naresh Sarker said the five had murdered Hoshi as part of a "campaign to destabilise the country and smear its image."
The defence said it would appeal the convictions.
Police say JMB, which has pledged allegiance to Daesh, also carried out a July 1, 2016 attack on a cafe in which 22 people were killed, mostly foreigners, before security forces ended a 12-hour siege, killing five gunmen.
Daesh claimed responsibility for the deadly cafe attack, but the government has dismissed suggestions the group has a presence in Bangladesh.
While authorities blame the violence on domestic militants, security experts say the scale and sophistication of attacks suggested links to transnational terrorism.
Attacks on foreigners are rare in Bangladesh. But it has seen a rising tide of violence in recent years, in which at least six online critics of religious militancy were hacked to death.
Since 2013, 48 people, including 20 in the cafe attack, have been killed or seriously wounded.