World champions Brazil beat host nation Germany 3-2 on Saturday to set up a meeting with Argentina or Mexico in the Confederations Cup final next Wednesday.
Brazil led the semi-final three times with two goals by Adriano (21st and 76th minutes) and a 43rd-minute penalty from Ronaldinho.
Germany equalised twice through Lukas Podolski (23 minutes) and Michael Ballack, who scored with a penalty in first-half stoppage time.
The hosts now go into Wednesday's third-fourth place playoff in Leipzig against Argentina or Mexico, who clash in Sunday's second semi-final in Hanover.