Diarra will travel to Madrid on Monday for tests and will be presented to the media on Tuesday.
“Real Madrid Football Club, Portsmouth FC and French midfielder Lassana Diarra have reached agreement today,” said a Madrid statement released on Sunday evening.
“The deal is subject to the player passing a medical. The player will remain with Real Madrid until 30th June, 2013.”
It is believed Diarra will cost the Spanish giants around £18.5million.