Edgars Masalskis has announced his retirement from international ice hockey ©Getty Images

Latvian goaltender Edgars Masalskis has announced his retirement from international ice hockey after the country failed to qualify for the Pyeongchang 2018 Winter Olympics.

The 36-year-old has represented Latvia for 16 years, including at three Winter Olympic Games in Turin in 2006, Vancouver in 2010 and Sochi in 2014.

He was also on the roster at Salt Lake City 2002 but didn't make an appearance.

He also played in 12 International Ice Hockey Federation (IIHF) World Championships, playing 159 matches for his country in all.

His debut came in a 2000 exhibition game against France. 

On the international stage he reached the last eight of major tournaments three times, including at Sochi 2014.

"It is time to stop playing for the Latvian national team," said Masalskis.

Edgars Masalskis suffered disappointment as Latvia failed to qualify for Pyeongchang 2018 ©Getty Images
Edgars Masalskis suffered disappointment as Latvia failed to qualify for Pyeongchang 2018 ©Getty Images

"It was a true honour for me to represent Latvia all these years.

"Thanks to all members and fans of the team."

Masalskis, who plays for Russian club side Lada Togliatti in the Kontinental Hockey League, had been hoping to help guide his side to another Olympics in Pyeongchang at their home qualification tournament in Riga earlier this month,

However, he served as only the third goaltender behind Kristers Gudlevskis and Elvis Merzlikins.

Latvia were denied as Germany took the sole spot available in South Korea from the four team group.

It means that Latvia won't compete in Olympic men's ice hockey for the first time since Salt Lake City.