BERLIN, Aug 26 (Reuters) - Bayern Munich have agreed terms with AS Roma to sign Morocco defender Mehdi Benatia to replace the injured Javi Martinez, who is out for the rest of the year, the German champions said in a statement on Tuesday.
Bayern said the 27-year-old Benatia will sign a five-year deal once he passes a medical in Munich this week.
France-born Benatia, who joined Roma in 2013 after three seasons at Udinese, will cost 25 million euros ($32.93 million) according to local media reports.
Benatia formed a strong partnership with Brazilian Leandro Castan last season after joining Roma from Udinese, helping his side to a second-place finish in Serie A.
The Moroccan, who has 31 caps, became unsettled, however, publicly accusing the Italian club of breaking promises regarding a salary increase.
Spain international Martinez tore cruciate ligaments in Bayern's Super Cup defeat by Borussia Dortmund earlier this month and will be out for at least six months, forcing coach Pep Guardiola to bring in a replacement.
($1 = 0.7592 Euros) (Reporting by Karolos Grohmann, additional reporting by Josh Reich, editing by Ed Osmond and Ken Ferris)