David de Gea has signed a new long-term contract with Manchester United, the Premier League club announced on Monday, ending months of speculation over his future.
The 28-year-old, who had been linked with a return to Spain with Real Madrid for several seasons, has put pen to paper on a new four-year deal.
"David de Gea has signed a new long-term contract with Manchester United, keeping him at the club until at least June 2023," United said on their official website. "There is an option to extend for a further year."
Former manager Alex Ferguson brought De Gea to the club from Atletico Madrid in 2011 in an £18.9 million ($23 million) deal and he has since made 367 appearances for the club.
“It has been a privilege to spend eight years at this great club and the opportunity to continue my career at Manchester United is a genuine honour," said the goalkeeper.
"Since I arrived here, I could never have imagined I would play over 350 games for this club. Now my future is fixed, all I want is to help this team achieve what I believe we can and win trophies again, together."
De Gea joined in the year that United reached their third Champions League final in four years.
The club's fortunes have since dipped under a succession of different managers but the Spaniard has won the Premier League, the FA Cup, the League Cup and the Europa League since arriving at Old Trafford.
"There's no place like home," he tweeted, accompanied by a video of himself the club's stadium.
Manager Ole Gunnar Solskjaer said he was delighted the Spaniard had committed his long-term future to the club.
"Over recent years, David has proved himself to be the best in the world and a vital part of our plans as we look to take Manchester United back to where it belongs. David is a fantastic person and his outstanding quality provides the perfect base to our defence"
De Gea, capped 40 times by Spain, came close to joining Real Madrid in 2015 only for a paperwork delay to stop the deal going through before the transfer deadline.
He would have been free to speak to any European clubs from January 1 and leave next summer on a free transfer.
Protracted negotiations over De Gea's future were offered as a reason for his poor form towards the end of last season, with the club finishing a lowly sixth in the Premier League.
He was also at fault for Patrick van Aanholt's late winner as Crystal Palace won 2-1 at Old Trafford last month.
He recently lost his place in the Spain team to Chelsea goalkeeper Kepa Arrizabalaga, although he was recalled for this month's Euro qualifying win over minnows the Faroe Islands.