Stuart Law is to leave his job as acting Sri Lanka coach to take a similar role with Bangladesh on a two-year contract.
The Australian will replace compatriot Jamie Siddons, whose contract is not being renewed, following Sri Lanka's current tour to England.
Law's first duty will be to lead Bangladesh in a Test and one-day series in Zimbabwe in August.
He is Bangladesh's fifth foreign coach since they began playing Tests.
Law's appointment comes after Bangladesh failed to reach the quarter-finals of the 2011 World Cup, beating England, Ireland and the Netherlands but losing to West Indies, South Africa and India in the first round.
They also suffered a 3-0 whitewash in their one-day series against Australia in April.
Law has been in talks with the Bangladesh Cricket Board (BCB) since May but needed clearance from Sri Lanka before accepting his new post.
He was quoted as telling Dhaka-based newspaper Prothom Alo that he made the decision after Sri Lanka failed to tie him in to a longer deal.
"I asked SLC [Sri Lanka Cricket] if they would want me to continue after November but they couldn't confirm anything so I told them that I won't continue after the UK tour," he said. "The most important thing for me is job security."
The BCB said Law would join on a two-year contract after Sri Lanka's ODI series in England concludes on 9 July.
Law, 42, had served as Sri Lanka's assistant coach under Trevor Bayliss since 2009 and was made interim coach after Bayliss stepped down in the wake of the World Cup.
He started his career in Australia then joined Essex in 1996 before moving in 2002 to Lancashire, where he later became captain.
BCB media committee chief Jalal Yunus said: "Stuart Law was far ahead on our shortlist for a new coach.
"It's not only his experience as a coach - his strong leadership abilities were a factor in our decision to make him head coach."
Bangladesh have won only two of 34 Test series since they played their first match at that level in 2000.
Thilina Kandamby, Sri Lanka's limited-overs vice-captain, was saddened by the departure of Law.
"He talked to us after the Twenty20 game [against England] on Saturday and told us he was going to leave," said Kandamby.
"He has been good for us, especially in England because he has played a lot. We have had a lot of good discussions with him and we will miss him."