Kendall Waston scored twice as Costa Rica survived a late rally from Chile to record a 3-2 away win in an international friendly at Rancagua's Estadio El Teniente.

The visitors, who had not won in their previous nine international matches dating back to before the World Cup in Russia, benefited from some poor defending from the hosts as they led 3-0 just past the hour mark on Friday.

Central defender Waston rose highest in the 36th minute to head home Joel Campbell's corner, despite the efforts of Arturo Vidal, who could not clear off the line.

The 30-year-old, who plays his club football for Vancouver Whitecaps, then scored his third goal in two games for Los Ticos, when he turned home after the ball ricocheted off a combination of the post and Gary Medel.

Four minutes later it was 3-0, Ronald Matarrita latching onto a long ball and firing into the top corner as boos rang out from the home supporters.

Chile pulled a goal back with 20 minutes remaining when Sebastian Vegas followed in to steer home the rebound after Nicolas Castillo's header was tipped onto the bar.

Alexis Sanchez's tame penalty was saved by Esteban Alvarado in the 82nd minute.

The Manchester United forward made amends minutes later when he controlled and finished to set up a tense finale.

But the hosts were unable to force a leveller in the six minutes of stoppage time, as Costa Rica held firm for a rare away win.