Mahamadou Diarra, centre, is on his way back to France. ((Angel Martinez/Getty Images))

Monaco agreed to a deal to sign Mali midfielder Mahamadou Diarra from Real Madrid on Thursday.

Monaco said on its website that Diarra was arriving in Monaco late Thursday, and the move will be finalized once he passes his medical test. Monaco gave no financial details of the deal but said it would be a permanent transfer.

The 29-year-old Diarra made only three substitute appearances in the Spanish league for Jose Mourinho's title-chasing Madrid this season.

Diarra joined Madrid from Lyon four years ago and went on to make 90 league appearances, scoring three times.

Monaco was in 19th place in the French league and battling against relegation. It recently replaced sacked coach Guy Lacombe with Laurent Banide.

This week, Monaco signed Montpellier midfielder Gregory Lacombe on loan until the end of the season.