The Germany international has signed a four-year contract with Dortmund, who have activated a clause in the player’s contract to free him one year before its scheduled conclusion for a fixed, undisclosed fee.
“I want to give myself some new stimulus in my career,” Castro told Leverkusen’s official website.
“It was not an easy decision. I had a fantastic time here over the years and this club will always have a place in my heart.”
Castro scored 25 goals in 286 games for Leverkusen, the club he joined as a 17-year-old back in 1999.
He can fill the void being left by Sebastian Kehl, who is to retire this summer.
“We’re delighted to have been able to sign such an experienced, technically-strong midfielder who can play a variety of positions,” said Dortmund’s director of sport Michael Zorc on the club’s official website.
He will link up with Dortmund’s new coach Thomas Tuchel for pre-season training in July.