Courtois had been strongly linked with a move to the Spanish capital all summer and failed to report for training this week as the deal - rumoured to be worth £38m - neared completion.
Midfielder Kovacic, meanwhile, will now join the Blues for the upcoming season in an agreement that is believed to include an option to buy next summer.
In a statement, Chelsea said: "Chelsea and Real Madrid have tonight agreed terms for the permanent transfer of Thibaut Courtois subject to the agreement of personal terms and passing a medical. Subject to the completion of the deal Mateo Kovacic will join the Blues on a season-long loan."
The agreement between the two parties comes after Chelsea reportedly finalised a deal to bring in 23-year-old Athletic Bilbao keeper Kepa Arrizabalaga as Courtois's replacement.
Courtois has been with Chelsea since 2011 and, following a three-year loan spell at Atletico Madrid, became the side's number one, going on to make 154 appearances and winning two Premier League titles, the FA Cup and the League Cup.