The club announced the deal with the Germany international, who has not played since August last year due to a back injury, shortly before the start of Tuesday's German Cup semi-final against VfL Wolfsburg with the player in the stands.
"I am grateful that the club gave me the chance to remain part of this special team and the entire environment," Gundogan said in a statement.
"I will do everything to be able to help my team mates soon again and am going into the coming weeks and months with a lot of optimism,."
The 23-year-old, a hugely talented and creative midfielder who helped Dortmund reach the Champions League final last season, is set to miss the World Cup in Brazil due to his injury.
He was on the transfer wish list of several top European clubs prior to his injury.
- Sports & Recreation
- VfL Wolfsburg