Alexis Sánchez became Chile’s all-time leading scorer when he scored an early goal in a 1-1 draw against Germany at the Confederations Cup on Thursday.

Lars Stindl equalised for the world champions just before half-time to leave both teams level at the top of Group B with four points each from their opening two games, although Chile have the better goal difference. Australia and Cameroon have a point apiece after their 1-1 draw earlier on Thursday.

The top two teams go through to the semi-finals and there is one round of matches in the group on Sunday, with Germany facing Cameroon and Chile playing Australia. Both Germany and Chile only need a point apiece to reach the semi-finals.

Sánchez’s goal was his 38th for Chile in 113 appearances as he overtook the previous scoring record held by Marcelo Salas.

Germany, now unbeaten in 12 games since their Euro 2016 semi-final exit, gifted Chile a sixth-minute lead when Shkodran Mustafi attempted to play the ball out of defence. He sent a pass straight to his Arsenal team-mate Sánchez, who played a one-two with Vidal and toe-poked the ball in off a post.

The referee interrupted Chile’s goal celebrations by appearing to call for a video reply, possibly to look at the scything tackle by Mustafi on Vidal, although the goal was quickly confirmed.

Matthias Ginter made a similar mistake soon after but was let off the hook as Germany struggled to cope with the South American side’s high pressing and quick passing. Chile came close to a second when Eduardo Vargas rattled the underside of the bar with a long-range drive and Sánchez continued to pester them with his runs down the left.

But Germany equalised against the run of play four minutes before half-time when Stindl turned the ball home from close range after Emre Can’s diagonal pass had released Jonas Hector down the left to fire a low cross into the middle.

Germany’s goalkeeper, Marc-André ter Stegen, then had to make a one-handed save at his near post to block a low drive from Sánchez just before the interval.

The second half was much quieter with Stindl producing Germany’s best effort, a low shot saved by Johnny Herrera. Their head coach, Joachim Löw, praised his team for recovering from conceding the early goal.

“It was a very intense match, a match that was marked by strategical play and it was very demanding in that sense,” Löw said. “We lived up to expectations and we were very disciplined for the entire 90 minutes. The key was to have a well-structured defence.

“Even though we conceded a goal we were able to come back and even though this is an inexperienced team, they still played at a high level. Our players were perhaps a bit nervous in the first 10 minutes and perhaps had some difficulties and we made a mistake for the goal and that’s how they scored. But we recovered immediately and our goal was excellent, it was a model goal scored from a couple of passes. Chile have been consistently playing at a very high level over years so our defence was excellent.”