(CNN) -- Brazil moved into the final of the Confederations Cup following a tense and dramatic 2-1 victory over Uruguay.
Following another day of protests in Belo Horizonte, where anti-government protesters clashed with police, the nation's football players gave its people some brief respite.
A late header from Paulinho was enough to push the samba stars over the line in a game where it was given a huge scare by its South American rival.
Diego Forlan squandered a glorious opportunity from the penalty spot in the first half before Fred fired Brazil ahead.
Edinson Cavani leveled after the break from close-range, but Paulinho's late effort sealed his country's place in the final against either Spain or Italy.
Contests between these two countries are always fiercely fought affairs with the Brazilians still scarred by their defeat in the 1950 World Cup final in Rio.
Then there was the pre-match spice added by Uruguay captain Diego Lugano, who accused Brazil star Neymar of diving.
Ironically, it was Lugano who hit the turf first, although there were no suggestions that he dived to win a first-half penalty.
The defender was wrestled to the ground by Chelsea defender David Luiz and referee Enrique Osses pointed to the spot.
Forlan, Uruguay's leading scorer, stepped up to take the kick but his effort was saved by Julio Cesar to send those draped in yellow inside the Estadio Mineirao into ecstasy.
That miss appeared to wake Brazil from its slumber and with just two minutes of the first half remaining, Neymar flicked the ball into Fred's path and the striker fired home with aplomb.
Uruguay responded almost immediately after the interval when Cavani stroked home, while Forlan wasted a fine opportunity to win the tie when he fired straight at Cesar.
Liverpool's Luis Suarez headed just over as Uruguay turned the screw against a fragile looking Brazilian backline.
But with the prospect of extra time looming, Paulinho rose highest at the far post to meet Neymar's corner and spark wild scenes of celebration.
Meanwhile, Real Madrid president Florentino Perez confirmed Wednesday that his club has agreed a deal for Malaga's Spain under-21 star Isco.
Isco is expected to become new manager Carlo Ancelotti's first signing since taking over from Jose Mourinho.
"There is already an agreement with the club and the player," Perez told Spanish National Radio.
"Isco will be presented next week, he just needs to pass the medical."
Italian side Juventus has confirmed the signing of Manchester City and Argentina striker Carlos Tevez on a three-year deal.
Tevez, 29, cost an estimated $13 million with the fee rising to a possible $15 million.