(CNN) -- Werder Bremen are through to the UEFA Cup final, where they will face Ukrainian side Shakhtar Dontesk, after winning 3-2 at Bundesliga rivals Hamburg on Thursday to progress on the away goals rule.
Claudio Pizarro celebrates scoring Werder's second goal in their thrilling 3-2 victory over Hamburg.
Hamburg were favorites to qualify after winning last week's first leg 1-0 in Bremen, but Thomas Schaff's side responded brilliantly to recover from going a goal behind on the night, and 2-0 on aggregate, to secure their place in the Istanbul showdown on May 20.
The defeat was a bitter body-blow for Bundesliga title chasers Hamburg, who were also beaten by their rivals on penalties in the semifinals of the German Cup last month.
Remarkably, the two sides also meet again on Sunday in the Bundesliga.
Hamburg took control of the tie in the 13th-minute when Croatian striker Ivica Olic latched onto a defense-splitting pass from Joris Mathijsen to flick the ball over Bremen goalkeeper Tim Wiese.
However, Werder levelled 16 minutes later when Claudio Pizarro flicked a pass through to Brazilian Diego, who stabbed home.
The game turned in the 66th minute when Pizarro's long-range shot took a slight deflection to beat Frank Rost, although the veteran Hamburg keeper will be disappointed he did not stop the shot.
Werder secured their place in the final with seven minutes remaining when Piotr Trochowski, Hamburg's match-winner in the first leg, tried to clear a corner but only succeeded in firing the ball at Bremen captain Frank Baumann, who bravely stuck his head out to nod home.
There was an element of controversy surrounding the goal, which came when Werder won a corner after a Hamburg back-pass deflected off a screwed-up piece of paper on the pitch, to go behind.
Olic netted his and Hamburg's second of the night with a close-range header, but Werder held on to secure a famous victory.
The only sour note for the visitors came with a first-half yellow card for Brazilian playmaker Diego, who misses the final through suspension.