The 28-year-old Brazil-born Spain international joined the Blues from Atletico in July 2014, scoring 59 goals in 120 appearances.
"The transfer will be subject to the agreement of personal terms and a medical."
Costa won two Premier League titles in his three seasons at Stamford Bridge, but admitted to pandering for a return to Atletico as early as his first season in England.
"The agreement is pending the formalisation of the contract between our club and the Spanish international forward.
"The English club has authorised Diego Costa to travel to Madrid in the coming days to undergo medical tests and settle his contract with our club."