Two goals from Adriano and a penalty by Ronaldinho gave world champions Brazil a 3-2 win over hosts Germany on Saturday and a place in the Confederations Cup final against Argentina or Mexico.
An entertaining match played under cloudless blue skies on a hot night in southern Germany was decided when man of the match Adriano outpaced defender Robert Huth to strike a well-placed left-foot shot wide of goalkeeper Jens Lehmann after 76 minutes.
"It was a mental victory more than anything else," Brazil coach Carlos Alberto Parreira told reporters. "I am very proud of my team because it is very, very difficult to beat Germany especially when they are at home."
Germany coach Juergen Klinsmann, whose side lost for only the second time in 15 matches since he took control a year ago, said: "We're a little bit disappointed.
"We wanted to reach the final (on Wednesday) and take a step forward against Brazil but in general we're satisfied."
Both managers made five changes to their teams but it was Brazil's guile and experience that paid off in the end.
Brazil twice took the lead in the first half, only for Germany to equalise rapidly on both occasions.
The South Americans played the neater, sharper football, with Robinho stretching the home defenders with his mazy dribbles and Huth given a torrid evening by Adriano as Brazil tested Germany's three-man defence with several piercing moves.
The Inter Milan striker netted Brazil's first from a free kick, won a penalty when Huth fouled him after 43 minutes and then grabbed the winner for his third goal of the tournament.
Germany, playing with more confidence than at the start of the competition but still looking nothing like the force of old, cancelled out Brazil's opener through Lukas Podolski and wiped out the second with a Michael Ballack penalty after he was tripped by Emerson.
But the hosts had no answer to Brazil's third goal and only two good stops by Lehmann in the closing minutes saved Germany from a heavier defeat.
SET-PIECES
The first two goals came from set-pieces midway through the first half.
Brazil opened the scoring from a 21st-minute free kick awarded by Chilean referee Carlos Chandia after Torsten Frings ended a jinking Robinho run with a clattering challenge 25 metres out.
Ronaldinho squared up as if he was taking the kick but made a decoy run, allowing Adriano to crack a curling left-footed effort that took a deflection off the wall and flew past the stranded Lehmann.
Germany were level within two minutes. Sebastian Deisler's 23rd-minute corner snaked across goal towards Podolski, who directed a well-placed header into the corner of keeper Dida's net.
Brazil went back in front two minutes before the break after Huth, battling for the ball with Adriano, pushed him over inside the by-line to concede a penalty.
Despite the jeers of thousands of home fans, Ronaldinho kept his cool to score with a low shot inside Lehmann's right-hand post even though the goalkeeper dived the right way.
Germany again pulled level three minutes into stoppage time, with another penalty.
Chandia spotted an Emerson trip on Ballack and the German skipper converted his third penalty of the tournament to make it 2-2 at halftime.
Germany 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.
Brazil's victory was their 12th in 21 meetings with Germany since 1963 and they will now attempt to win the Confederations Cup for the second time, following their maiden triumph in the inaugural competition in 1997.
Parreira's team are also bidding to achieve a rare treble by adding this crown to their Copa America and World Cup titles.
Brazil lifted the 2002 World Cup after beating Germany 2-0 in the final in Yokahama, Japan.
More from rediff