ICC Men's World Cup, Delhi
Sri Lanka 279 (49.3 overs): Asalanka 108 (106), Nissanka 41 (36); Tanzim 3-80
Bangladesh 282-7 (41.1 overs): Shanto 90 (101), Shakib 82 (65); Madushanka 3-69
Bangladesh won by three wickets
Sri Lanka's Angelo Mathews said Bangladesh's actions were "disgraceful" after he became the first international cricketer to be timed out in his side's World Cup loss in Delhi.
An already stormy encounter was ignited by Mathews' dismissal, which happened when he failed to take guard in sufficient time after walking to the crease.
Bangladesh captain Shakib Al Hasan appealed and Mathews stormed off.
Much of the delay was down to the strap on Mathews' helmet snapping as he prepared to bat, but the fourth umpire said he had already taken too long regardless.
"I hadn't done anything wrong," said the 36-year-old. "I have two minutes to get to the crease and get myself ready, which I did, and then it was an equipment malfunction.
"I don't know where the common sense went because obviously it is disgraceful from Shakib and Bangladesh if they want to play cricket like that. To stoop down to that level there is something drastically wrong.
"I still had five seconds to go after my helmet broke. I'm not talking about 'Mankading' [running out a batter at the non-striker's end] or obstructing the field, I am just talking about common sense. It is absolutely disgraceful.
"We talk about the safety of the players, but you guys tell me if it is right for me to take my guard without my helmet?"
With Bangladesh already eliminated and Sri Lanka needing a miracle to progress, Champions Trophy qualification was set to be the focus of a match that went ahead despite poor air quality in the Indian capital.
However, that all changed two balls into the 25th over of the Sri Lanka innings when Mathews walked out following Sadeera Samarawickrama's dismissal.
Under the International Cricket Council's rules for the World Cup, a batter must be ready to face the next ball within two minutes of the previous dismissal and, while cutting it fine, there was no suggestion of a problem before the chinstrap on Mathews' helmet snapped as he attempted to tighten it.
When he called for a replacement, causing a delay, Bangladesh captain Shakib appealed and a furious Mathews was eventually given out.
While Sri Lanka's players and coaches raged off the field, Charith Asalanka kept his cool on it, taking his frustrations out on the bowlers to reach his second one-day international century.
He fell for 108 from 105 balls in the penultimate over of the innings as Sri Lanka were bowled out with three balls left unused.
Left-arm seamer Dilshan Madushanka removed openers Tanzid Hasan and Liton Das early in the Bangladesh chase but Shakib was dropped on seven off the bowling of Mathews and it proved costly.
He and Shanto started steadily but the boundaries were soon flowing and Sri Lanka, still seething at a perceived injustice, had no answers.
Mathews gave them hope when he ousted both set batters in quick succession and they proceeded to take another three wickets before Bangladesh sealed the win in the 42nd over.
Defeat confirms Sri Lanka's elimination from semi-final contention on the day in which the country's sports minister Roshan Ranasinghe sacked the national cricket board following their humiliating loss by India in their last game.
Sri Lanka anger evident in tempestuous second innings
Sri Lanka's anger at Mathews' dismissal was evident and captain Kusal Mendis and coach Chris Silverwood both held conversations with fourth umpire Adrian Holdstock.
Holdstock spoke at the innings break and said "the batter wasn't ready within those two minutes even before the strap became an issue for him", suggesting the helmet delay was not the reason for his unusual dismissal - the first of its kind in 146 years of international cricket.
That explanation did little to calm Sri Lanka before they went out to field and they celebrated the early wickets of Tanzid and Das with gusto.
However, as Shanto and Shakib's partnership grew, so too did the fielding side's frustration.
Predictably, Mathews and Shakib exchanged words, as did Samarawickrama and Shanto, and the umpires were also surrounded by six Sri Lanka players midway through the innings as they asked for the ball to be changed.
That fight began to wane as Bangladesh got closer to their target but five wickets in nine overs gave brief hope of a win that would have been so sweet for the 1996 champions.
'I did everything needed for my team to win' - what they said
Sri Lanka captain Kusal Mendis, via a translator: "It is very disappointing that when Angelo came to the crease there were like five seconds left for him to be ready and he found out that his helmet strap came out.
"It was an equipment failure so I'm disappointed that the umpires couldn't react there and apply common sense. It is unfortunate that it happened during a crucial time."
Bangladesh captain Shakib Al Hasan: "I feel like I was at a war so I had to take a decision to make sure my team wins so whatever I needed to do I had to do it.
"Right or wrong there will be debates. But if it is within the rules I don't mind taking those chances."
Fourth umpire Adrian Holdstock on Mathews' dismissal: "The TV umpire monitors the two minutes and he will then relay the message to the standing umpire.
"In this instance the batter wasn't ready within those two minutes even before the strap became an issue for him. The two minutes had already elapsed."