Lee Chong Wei finally defeats old foe Lin Dan

Lee Chong Wei finally got the better of old foe Lin Dan at an Olympic Games by winning a thrilling men's badminton singles semifinal on Friday.

Lee Chong Wei and Lin Dan embrace at the end of the semifinals.   -  AP

Lee Chong Wei finally got the better of old foe Lin Dan at an Olympic Games by winning a thrilling men's badminton singles semifinal on Friday.

Malaysian Lee has been the nearly man of the Olympics having finished runner-up to Lin in Beijing in 2008 and London four years ago.

But on this occasion Lee came from a game down to earn a 15-21, 21-11, 22-20 victory to progress to Rio 2016's gold medal match, where Chen Long awaits.

It was almost another agonising heartbreak for Lee as Lin saved three match points, including a scarcely believable recovery in a mammoth rally when trailing 20-19.

Lee was not to be denied, though, as he finally settled the contest at the fourth attempt before the two men showed true Olympic spirit by exchanging shirts and a warm hug at the end of the contest.