Switzerland advanced to the knockout stage of the 2018 World Cup with a 2-2 draw here Wednesday against a Costa Rica side who achieved their hopes for a dignified exit.Also Read - VIDEO: Kylian Mbappe Misses Penalty as Switzerland Stuns France in Euro 2020 | WATCH

The Central Americans, who defied expectations by reaching the quarterfinals in 2014, lost their first two matches of the 2018 tournament and began Wednesday’s contest needing a win to have any hope of qualifying from Group E. Also Read - WATCH: Diego Maradona Scores Iconic 'Hand of God' Goal Against England at 1986 World Cup

With 4 points, Switzerland could afford to settle for a draw against Costa Rica. Also Read - FIFA Cancels Next Year's U-17 Women's World Cup in India, Allots it 2022 Edition

The underdogs dominated for the first 20 minutes at Nizhny Novgorod Stadium, mounting one assault after another on the opposing goal.

But Switzerland withstood the onslaught thanks to keeper Yann Sommer, who made quality stops against Joel Campbell, Celso Borges, Daniel Colindres, and David Guzman to keep his side in the game.

Granit Xhaka and Valon Behrami gradually restored some balance for the Swiss and it was the Europeans who opened the scoring, a strike by Blerim Dzemaili in the 31st minute that left Costa Rican keeper Keylor Navas with no chance.

Leading 1-0, the Swiss looked tentative to start the second half and the determined Costa Ricans exploited the weakness to pull level with Kendall Waston’s header off a corner in the 57th minute, his squad’s first goal of the competition.

While the equalizer did not spark an immediate response by the Swiss, they took the lead again in the 88th minute with Josip Drmic’s goal.

A penalty call in stoppage time sent Costa Rica’s Bryan Ruiz to the spot and Sommer inadvertently knocked the ball into the net to make it 2-2.

Switzerland will begin the round of 16 next Tuesday with a match against surprise Group F winners Sweden.