London: Manchester United said on Friday they have agreed to sign Real Madrid midfielder Casemiro in a deal worth up to a reported £60 million ($70 million).

United manager Erik ten Hag has been desperate to land a defensive midfielder since taking charge at Old Trafford and has finally settled for Casemiro after failing to sign Barcelona's Frenkie de Jong.

Troubled United, who sit bottom of the Premier League after embarrassing defeats against Brighton and Brentford, are set to pay an initial £50 million.

The overall fee would rise by another £10 million if certain clauses in the contract are met.

Casemiro has been offered a four-year contract with the option of a further 12-month extension, with the transfer subject to the agreement of personal terms.

The 30-year-old joined Real from Sao Paulo in 2013 and has been a key figure in midfield for the Spanish club, winning five Champions League titles.

"Manchester United is delighted to announce that the club has reached agreement with Real Madrid for the transfer of Casemiro," a statement from United said.

"The transfer is subject to the agreement of personal terms, UK visa requirements and a medical."

Ten Hag refused to discuss the transfer at his press conference earlier on Friday, but Real boss Carlo Ancelotti was more forthcoming when speaking to the media in Spain.

"I've discussed it with him this morning. He wants to try a new challenge, a new opportunity," Ancelotti said.

"The club understand it. With all he's done for this club and the person he is, we have to respect it.

"If he doesn't stay, we'll have an enormous sense of gratitude to him for all he's done. We have replacements within the squad."

Real Madrid said they will hold a "tribute and farewell" to Casemiro on Monday which will be attended by the club's president, Florentino Perez.

In a statement, the Spanish giants called him "one of the most transcendental players in one of the most significant and successful periods in our history."

"Real Madrid are and always will be his home, and we wish him and all his family the best of luck in this new chapter of his life," it added.

Casemiro played alongside current United stars Cristiano Ronaldo and Raphael Varane in the Spanish capital.

His arrival will fill a void in Ten Hag's midfield after his prolonged pursuit of De Jong ended in failure.

Casemiro's wealth of experience and success at the highest level will make him a certain starter instead of either Fred or Scott McTominay in central midfield.

He is unlikely to be available for United's next match against arch rivals Liverpool at Old Trafford on Monday.

Instead, Casemiro's debut could come at Southampton in the Premier League on August 27.