Jesus Navas scored the decisive penalty as World Cup holder Spain beat Italy 7-6 in a shootout on Thursday after extra time ended 0-0, setting up a showdown with host Brazil in the Confederations Cup final.

Nobody missed in the shootout until Italy defender Leonardo Bonucci shot high to give Navas an attempt at the winner and the Seville midfielder coolly beat goalkeeper Gianluigi Buffon to send Spain to another major final.

In draining heat and humidity, each side hit the woodwork in extra time. Emanuele Giaccherini smashed a shot off the post in the 93rd minute and Buffon deflected a shot from Xavi Hernandez off the post in the 115th.

Italy will face Uruguay in the third-place match in Salvador, also Sunday.

In a rematch of the Euro 2012 final, which Spain won 4-0, Italy threatened early on even without the injured Mario Balotelli, relying on counterattacks, while Spain relied on its usual game of short passes and ball possession.

The roles reversed in the second half but it wasn’t until extra time that each side produced some of the match’s best chances.

When English referee Howard Webb whistled the end of extra time in the 120th minute, the crowd inside the Castelao Stadium cheered loudly, applauding two classy teams.

Before kickoff, about 5,000 anti-government protesters battled police about 2 kilometers (1 mile) from the stadium.

More protests are expected Sunday at the final of the World Cup warm-up tournament at the Maracana stadium in Rio de Janeiro.

Thursdays’ were the latest in a series of massive, nationwide protests that have hit Brazil since June 17. Demonstrators are angered about corruption and poor public services despite a heavy tax burden.

Protests are also denouncing the billions of dollars spent to host the World Cup and the 2016 Olympics in Rio de Janeiro.

Sunday is the fourth major final Spain will play in five years, having won the 2008 and 2012 European Championships plus the 2010 World Cup.

Inside the stadium, which appeared full, there was overwhelming support for Italy from the local fans, who were perhaps afraid of facing Spain in the final. Spain was booed early on every time it took the ball.

Christian Maggio had the best chance of the first half in the 36th with a header inside the box that Spain goalkeeper Iker Casillas did well to block.

A minute later, Xavi Hernandez set up Spain’s only real chance early on as Fernando Torres shot wide.

Reverted to a three-man defense, Italy coach Cesare Prandelli made another tactical move to start the second half, replacing center back Andrea Barzagli with midfielder Riccardo Montolivo and putting De Rossi at the center of the defense.

Seeking to inject some energy into his squad, Spain coach Vicente Del Bosque sent on Navas for David Silva in the 52nd and Navas had the first significant chance of the second half six minutes later with a long, low effort that Buffon controlled.

The roles reversed as the second half wore on, with Italy controlling more and and Spain resorting more to counterattacks. Italy had a series of corner kicks at one point but had trouble producing chances.

Navas threatened in the 92nd with a long shot that appeared to surprise Buffon but the goalkeeper quickly recovered. A minute later, Giaccherini hit the post and then Jordi Alba volleyed high from close range as all of a sudden there was a flurry of chances.

In the shootout, Italy went first and Antonio Candreva, Alberto Aquilani, Daniele De Rossi, Sebastian Giovinco, Andrea Pirlo and Riccardo Montolivo each converted near perfect penalties for the Azzurri. Bonucci is a center back who rarely, if ever, takes penalties.

Buffon guessed right on Navas’ shot but the ball was so close to the striker’s left post that the goalkeeper had no chance.

More In: Football | Sport