Juan Mata has signed a new contract with Manchester United, the club have confirmed.
The midfielder, who would have been available on a free transfer from June 30, has put pen-to-paper on a new two-year deal that will keep him at Old Trafford until 2021 with the option of another year.
"It is a real honour to continue to represent this amazing club and our incredible fans," Mata said. "I have been at Manchester United for five years and I am proud to call Old Trafford my home.
"I am looking forward to working with Ole and his fantastic coaching staff; the vision that they have for the club is truly exciting and I am so happy that I will be a part of that."
Talks between the 31-year-old and United stalled with the club reluctant to offer more than a one-year extension.
A longer agreement has now been reached and Solskjaer has stressed the importance of Mata's experience in coming to the decision.
"Juan is the ultimate professional and one of the most intelligent players I have worked with," Solskjaer said. "He is a great example to our younger players in his approach.
"He understands what it means to be a Manchester United player and has embraced everything about this great club.
"As well as everything he brings on the pitch, we have some fantastic young players here and I know that Juan's vast experience will help them to reach their potential over the coming seasons.
"I am delighted that he has signed a new contract, as I know that his talent and mentality will be invaluable to the squad."