The Polish shot-stopper was released by the Reds at the end of last season and had been linked with Bolton and Manchester City.
But the 34-year-old told Polish newspaper Rzeczpospolita: "On Sunday or Monday I will fly to Spain to pass medicals.
"On the same day I will sign a contract and will be presented as a new Real player. I hope so and I am really happy with this.
"The offer from Real overshadowed all the others. I was considering a return to Feyenoord, Jacek Krzynowek was encouraging me to join him at Wolfsburg, an interesting offer from a respected newly promoted Premiership club appeared and I was also thinking of moving to Portugal.
"However, when Real showed interest I was very proud and did not think long."