Updated

Brazil needed an 86th-minute goal from Paulinho to overcome a stubborn Uruguay side and advance to the final of the Confederations Cup with a 2-1 victory on Wednesday.

Diego Forlan missed a first-half penalty kick that would have given Uruguay the lead, while Fred scored a few minutes before halftime to put the hosts in front.

Edinson Cavani took advantage of a failed clearance in the 48th minute to pull Uruguay level, but Paulinho was the hero on this day as he headed home Neymar's corner kick to send Brazil to Sunday's final, where they will meet the winner of the other semifinal between Spain and Italy.

Uruguay defended well for much of the first half, and was handed the opportunity to take the lead in the 13th minute when Brazil defender David Luiz pulled down Uruguay's Diego Lugano inside the penalty area.

Forlan stepped forward to take the kick, but goalkeeper Julio Cesar dove to his left and got down low to tip the shot past the post.

It was a huge chance squandered for Uruguay, and Brazil took the lead in the 41st minute when Neymar tracked down a long ball inside the area and forced a save from goalkeeper Fernando Muslera, only for Fred to score on the rebound.

Cavani had yet to score in the competition before Wednesday, but he took advantage of a poor pass from Thiago Silva and intercepted the ball inside the penalty area before rolling it inside the far post.

Uruguay seemed content to take the game into extra time as the match wound down, but Brazil capitalized on one of its many corner kicks with Paulinho getting free at the back post to head the ball home from a few yards.