Angel di Maria of Argentina celebrates scoring his team's first goal in extra time during the 2014 FIFA World Cup Brazil Round of 16 match between Argentina and Switzerland at Arena de Sao Paulo on July 1, 2014 in Sao Paulo, Brazil. (Source: Julian Finney/Getty Images)

SAO PAULO (AP) Angel Di Maria scored deep into extra time Tuesday to give Argentina a 1-0 win over Switzerland and a spot in the World Cup quarterfinals.

With a penalty shootout looming, Lionel Messi made a surging run toward the Swiss area in the 118th minute and laid the ball off to Di Maria on the right.

The winger struck a left-foot shot past diving goalkeeper Diego Benaglio, prompting the Argentine bench to jump out on the field to celebrate the goal.

Swiss substitute Blerim Dzemaili nearly equalized right before the end but his header hit the post, and the rebound bounced off his knee and wide of the goal.

The result at Sao Paulo’s Itaquerao Stadium continued Argentina’s record of scraping by with narrow wins at this World Cup. Coach Alejandro Sabella’s men will play the winner of Belgium and the United States in the quarterfinals.

It was a dramatic ending to what had been a tight match, with Argentina struggling to break through Switzerland’s disciplined defense.

Though Argentina dominated possession from the start, it was Switzerland that had the best chances in the slow-paced first half. Xherdan Shaqiri cut in from the left in the 28th and found Granit Xhaka in the middle of the penalty area, but Sergio Romero stopped Xhaka’s shot with his left foot.

Alone with Romero, striker Josip Drmic wasted a chance to score 10 minutes later with a botched attempt to chip over the Argentina goalkeeper.

Argentina’s attack improved after the break when fullback Marcos Rojo launched raids down the left flank, feeding crosses to the Argentine attackers.

Just after the half-hour mark Gonzalo Higuian finally got an attempt on target as he connected with Rojo’s cross, forcing Benaglio to a fingertip save.

In the 78th, Messi tested Benaglio again as he dribbled into the area and struck a low shot that the Swiss goalkeeper stopped at his right post.

Benaglio kept Switzerland in the game when got a hand on Di Maria’s shot in 109th minute, but had no chance on Argentina’s winner.

Second-half substitute Rodrigo Palacio won the ball in midfield and fed Messi, who dribbled down the middle in trademark fashion, escaping a challenge from Swiss defender Fabian Schaer before poking the ball to Di Maria.

Unmarked, the Real Madrid player beat Benaglio with his 10th goal in Argentina’s colors.