The first semi-final in the Confederations Cup pitted hosts Brazil against their South American counterparts Uruguay.
Diego Forlan had the chance to send Uruguay ahead from the spot after 15 minutes, but Julio Cesar made a fine save to his left.
It was Brazil who went into half time in the lead, however, courtesy of a close-range strike from Fred in the latter stages of the half.
Uruguay were level early in the second period with Edinson Cavani converting from inside the box. However, Brazil won it in the final five minutes when Paulinho headed a Neymar corner into the back of the net.
Read how it all unfolded in Sports Mole's minute-by-minute live commentary of the action below.
BRAZIL: Cesar; Alves, Silva, Luiz, Marcelo; Gustavo, Paulinho; Oscar, Hulk, Neymar; Fred
URUGUAY: Muslera; Pereira, Lugano, Godin, Caceres; Arevalo, Gonzalez, Rodriguez; Forlan, Cavani, Suarez