MADRID - Real Madrid have agreed to sign France midfielder Lassana Diarra from Premier League Portsmouth, the Spanish champions said on Sunday. Diarra, 23, who will undergo a medical on Monday, has agreed a contract until 2013, the Primera Liga side said on their website. No details of the deal were given but British media have reported Real were prepared to pay about 20 million pounds ($31 million). He is their second signing for the January transfer window after Dutch striker Klaas Jan Huntelaar was landed from Ajax, although youth team player Dani Parejo has also been recalled from his loan spell with Queens Park Rangers to join the first team. Diarra will help cover for Mali's defensive midfielder Mahamadou Diarra, who has been ruled out for the rest of the season with a knee injury. The signings are part of a plan to boost Real's campaign after a poor run of form which saw coach Bernd Schuster sacked and replaced by Juande Ramos just over a week ago. Real's 1-0 league win over Valencia on Saturday ended a run of three straight defeats but left them well off the blistering pace being set by Barcelona at the top of the table. Diarra joined Chelsea in 2005 from then-Ligue 2 club Le Havre, and has since won the FA Cup twice, first with the west London club in 2007 and then with Portsmouth in May. The midfielder, who has played 16 times for France, moved to Arsenal in August 2007 before joining Portsmouth in January. Elsewhere in the Primera Liga, Malaga said on Sunday they had agreed to sign attacking midfielder Adriano Ferreira from Brazilian club Internacional until the end of the season.