Costa Rica’s Bryan Ruiz, left, celebrates with his teammates Rodney Wallace, center, and Kendall Waston after scoring his side’s second goal during the group E match between Switzerland and Costa Rica, at the 2018 soccer World Cup in the Nizhny Novgorod Stadium in Nizhny Novgorod , Russia, Wednesday, June 27, 2018. (AP Photo/Natasha Pisarenko)

Switzerland reached the last 16 of the 2018 World Cup in Russia after a 2-2 draw with already eliminated Costa Rica at the Nizhny Novgorod Stadium.

The Red Crosses needed a draw to progress to the knockout stage and took the lead in the 31st minute through Blerim Dzemaili’s strike, before Kendall Waston headed Costa Rica level early in the second-half.

Substitute striker Josep Drmic restored the Swiss’ adavantage with two minutes of normal time to play.

Costa Rica equalised again in stoppage time when they were awarded a penalty, after being denied a penalty by VAR review two minutes earlier.

Bryan Ruiz’s spot-kick cannoned off the crossbar, onto the back of Switzerland goalkeeper Yann Sommer and into the net as Sommer was credited with an own goal.

Switzerland finished second in Group E on five points behind Brazil, who beat Serbia in Moscow to top the table on seven points.

Costa Rica finished bottom of the group with a single point.

Costa Rica started strongly, forcing three saves from Yann Sommer within 30 seconds as Joel Campbell, Celso Borges and Cristian Gamboa were all denied in the sixth minute.

They then came within inches of scoring five minutes later when Daniel Colindres powered an effort off the under side of the bar from the edge of the box.

Switzerland grew into the half and took the lead after 31 minutes when Dzemaili drilled past Keylor Navas from the middle of the box, after Breel Embolo’s header fell to him.

Costa Rica started the second-half brightly as they did in the first period and were deservedly level after 56 minutes when Kendall Waston met an inviting Campbell corner.

Waston lost his marker Manuel Akanji to power his header past Sommer and score Costa Rica’s first goal of the 2018 World Cup.

Chances dried up until the 78th minute when Drmic headed against the post after Embolo’s cross.

Switzerland were back in front 10 minutes later when substitute Denis Zakaria picked out Drmic, who made no mistake this time as he swept home impressively.

More late drama followed just a minute later when Costa Rica were denied a spot-kick in the 89th minute for offside following a VAR review, after referee Clement Turpin originally gave a penalty.

Costa Rica did have their penalty two minutes later when Campbell was fouled by Zakaria.

Bryan Ruiz’s effort hit the underside of the bar and went in off Sommer’s back as the game finished 2-2 and Costa Rica deservedly earned their first point of the tournament.

Switzerland will now face Sweden in the round of 16 on Tuesday July 3 in St Petersberg.

Switzerland XI: Sommer, Lichtsteiner (C), Schar, Akanji, Rodriguez, Behrami, Xhaka, Shaqiri, Dzemaili, Embolo, Gavranovic.

Subs: Zakaria, Drmic, Lang.

Costa Rica XI: Navas, Gamboa. Acosta, Gonzalez, Waston, Oviedo, Ruiz (C), Borges, Guzman, Colindres, Campbell.

Subs: Wallace, Azofeifa, Smith.