KAZAN, Russia — Alexis Sanchez became Chile’s all-time leading scorer Thursday night as it was held by Germany to a 1-1 tie in the Confederations Cup. Both teams were in a good position to make the semifinals.

Sanchez netted his 38th goal for Chile after a smart pass by Arturo Vidal in the sixth minute. The ball hit the near post before crossing the line to allow him to eclipse Marcelo Salas as the highest scorer for the national team.

“It makes me very happy to have become the team’s greatest scorer,” Sanchez said. “I’m happy for what the team has done, for our effort. We are confident that we can win this tournament.”

Suffering from an ankle sprain, Sanchez did not start the first game of the pre-World Cup tournament, playing only a few minutes in the victory over Cameroon.

Germany, with only three players from its 2014 World Cup-winning team, played catch-up most of the time against the more experienced Chileans, but earned the draw after Lars Stindl scored from close range in a counterattack just before halftime.

The result left both teams with four points each in Group B, three more than Australia and Cameroon, which played out a 1-1 draw hours earlier in St. Petersburg, Russia.