MUNICH — Germany goalkeeper Manuel Neuer has extended his contract at Bayern Munich by two years through June 2023.

The 34-year-old Neuer, Bayern’s captain, had been involved in protracted negotiations with the club, particularly after it signed a would-be replacement in Alexander Nübel from Schalke for next season.

But talks to reassure Neuer of his place in the club evidently paid dividends with Bayern announcing his extension on Wednesday.

“I can easily put myself in the situation Manuel is in,” said board member Oliver Kahn, himself a former goalkeeper. “We understand the direction Manuel wants to take in this phase of his career and what’s important to him. He’s sent a strong signal with this extension.”

Bayern announced in January that it would sign the 23-year-old Nübel on a free transfer for five years from July 1.