BERLIN — Pierre-Emerick Aubameyang scored a cheeky penalty for Borussia Dortmund to win the German Cup final over Eintracht Frankfurt 2-1 in what could have been his last game for the club on Saturday.

Aubameyang, the Bundesliga top scorer with 31, chipped the ball straight down the middle as Frankfurt goalkeeper Lukas Hradecky dived, giving Dortmund the title at the fourth attempt after losing the previous three finals.

He has been the subject of transfer speculation linking him with a big-money move away in the summer. He finished the season with 40 goals across all competitions.

"These are wonderful moments. Moments we worked for. It wasn't easy. The team earned it," said Dortmund president Reinhard Rauball, alluding to the difficulties players faced after the bomb attack on the team bus in April.

Dortmund coach Thomas Tuchel claimed his first trophy in what was possibly his last game at the club, too. Tuchel has fallen out with Dortmund's management.

"It's one of the nicest days in my coaching career. I have to let it all sink in," said Tuchel, whose side knocked out defending champion Bayern Munich in the semifinals.

"I have a contract and I want to fulfil it," said Tuchel, whose contract runs to 2018. "It seems to me as though the outcome to the talks is open."

Tuchel said Dortmund would not have won the title if there wasn't a good bond between him and the players.

"There has to be a trust between players and coach for you to reach your goals. That's why Frankfurt was such a tough opponent, because there's such a great bond between them."

Ousmane Dembele got his side off to a great start in the eighth minute when he eluded Jesus Vallejo on the right and curled the ball inside the far post.

Police made an appeal to Dortmund fans not to celebrate with pyrotechnics after more were lit behind the west-end goal. The final had kicked off under a cloud of smoke after flares were lit among Dortmund fans.

Frankfurt gradually worked its way back into the game - Haris Seferovic and Ante Rebic both went close - before Rebic equalized in the 29th. Marco Fabian won the ball in midfield, played Mijat Gacinovic through, and Gacinovic squared the ball for Rebic to beat Roman Buerki in the Dortmund goal.

Dortmund was forced into two changes at the break: Christian Pulisic came on for the injured Marco Reus (right knee) and Gonzalo Castro replaced Marcel Schmelzer (left thigh).

"It might be a bit of cruciate," Reus said of his injury after claiming his first title.

Fabian rescued Frankfurt with a goal-line clearance from Aubameyang's overhead kick off Dembele's dinked cross.

But Aubameyang, who'd had a quiet game, cheekily scored the winner midway through the second half after Hradecky brought down Pulisic to concede the spot kick.

Frankfurt brought on "football god" Alexander Meier for a defender in response but he was unable to get the side out of the jam.

"Of course you're disappointed. But I also know to value it. Losing is part of football," said Frankfurt coach Niko Kovac, whose side finished the season empty-handed.

Dortmund's win meant Hertha Berlin qualified for the group stages of the Europa League, while Freiburg's seventh place in the Bundesliga was enough to go into the Europa League qualifiers, as Dortmund had already qualified for the Champions League and won't be using the German Cup winner's Europa League place.