SANTIAGO, Chile (AP) — Chile defeated Ecuador 2-1 on Tuesday as both countries qualified for next year's World Cup in Brazil.

Chile finished third in the South American qualifying group with Ecuador in fourth, claiming the two remaining automatic berths from the region. Argentina and Colombia had already qualified as the top two teams.

Alexis Sanchez scored for Chile in the 35th minute and Gary Medel added another three minutes later, while Felipe Caicedo scored for Ecuador in the 66th.

Uruguay, despite a 3-2 victory against Argentina on Tuesday, finished fifth and goes into a two-match playoff against Jordan for another spot in Brazil. Uruguay and Ecuador both finished with 25 points from 16 matches, but Ecuador had the better goal difference.