Costa Rica maintained its unbeaten record at home against the United States in World Cup qualifying with a 2-0 win at the Estadio Nacional in San Juan on Wednesday night.

Despite the result, the U.S. still finishes third in CONCACAF’s Octagonal qualifying table behind first-placed Canada and second-placed Mexico, thus securing an automatic spot in Qatar at year’s end. Costa Rica is in fourth, meaning it will play a one-off match against New Zealand in Qatar to determine which of those two teams make the finals.

– 2022 World Cup: Draw date, time, seeds | Who’s in, who’s in contention?

Keylor Navas was called into action twice in the early going, palming away solid efforts from Antonee Robinson and Ricardo Pepi as the U.S. looked for a first World Cup qualification win at Costa Rica in the team’s history.

Despite having the better of possession and playing against a rotated Costa Rica side, Gregg Berhalter’s XI failed to find a way through the hosts’ defense as the first half ended scoreless.

Costa Rica took the lead early in the second half from a corner kick when Juan Vargas met Brandon Aguilera’s whipped in ball and powered a header past Zack Steffen to make it 1-0.

The hosts doubled their lead shortly after as Anthony Contreras swept home at the far post from a Jewison Bennette cross following a mad scramble in front of goal that saw Steffen pulled all the way out to the penalty spot.

The Americans steadied the ship and kept the deficit at two, ensuring a spot at the 2022 World Cup — the 11th appearance in team history — after missing out on the 2018 edition following a loss to Trinidad and Tobago on the final day of qualification in 2017.