"The three years with the players and the club were outstanding," said Guardiola, who led Bayern to the Bundesliga crown in each season. "I'll miss my players. It was a great experience and a lot of fun."

Dortmund counterpart Thomas Tuchel said he would miss the Spanish coach.

"It's like many things that you only notice when they're gone what an effect they had," Tuchel said.

Dortmund, which last won the cup in 2012, has lost three straight finals after defeats to Wolfsburg in 2015, and to Bayern in 2014 in extra time.

"It's extremely bitter, to lose that way," Buerki said of the shootout. "We fought and tried everything."

Both sides missed chances to win before the shootout in what was a tense encounter contested to the limits of the players' endurance, though Buerki was by far the busier goalkeeper.

Pierre-Emerick Aubameyang missed a great chance to win it for Dortmund with five minutes remaining when he blazed over from close range on a counterattack, while Robert Lewandowski had come closest for Bayern.

"We had huge chances in the 120 minutes to score the decisive goal," said Tuchel, who was very critical of his side's performance. "It was very hard to find five good penalty-takers."

Dortmund captain Mats Hummels had to go off with more than 10 minutes remaining in regular time in his last game for the club. The Germany defender is joining Bayern next season.

"He asked to be taken off," Tuchel said. Asked about Hummels' performance, he replied, "He can be better."

There were few opportunities for either side in the first half with marking tight, leaving space at a premium. Jerome Boateng tried a long ball for Lewandowski but the striker was hustled off the ball by his former teammates.

Costa tested Buerki in the 33rd - the first save either goalkeeper had to make - and Hummels managed to clear the rebound as Mueller's penalty appeals were waved away. TV replays showed he fell easily under Sokratis' challenge.

Bayern winger Franck Ribery, who was having a poor game, was lucky to escape with just a yellow card after grabbing Gonzalo Castro in the face after a tussle between them. Castro was also booked.

The second half began under a cloud of black smoke after fans in the Dortmund block set off flares and firecrackers.

More chances presented themselves with both sides taking more risks. Aubameyang blazed over after he was set up by Reus, Boateng cleared off the line, Lewandowski fired just over, and Neuer was quick out of his goal to intercept a dangerous ball for Aubameyang.