Atletico Madrid has reached a deal with Chelsea to sign striker Diego Costa.

The Spain international will travel to Madrid in the coming days to undertake a medical and finalize personal terms.

The 28-year-old will reportedly cost a fee that could rise to €60 million (US$71.6 million), depending on bonuses.

Costa will complete his move in January, when the transfer window reopens and Atletico's ban on signing new players comes to an end.

"Atletico Madrid and Chelsea have reached an agreement in principle for the transfer of Diego Costa," an Atletico statement confirmed. "The agreement is subject to the signing of a contract between the club and the Spain international."

Chelsea also confirmed the news in a statement on its official website.

The news means the end is in sight for one of the more protracted transfer sagas of 2017, which began with rumors of a possible exit as early as January.

Costa then claimed in June that Chelsea boss Antonio Conte had told him via a text message that he was free to leave the club, despite having scored 20 goals to help them to a second Premier League title in three seasons.

Atletico have long been favorites to sign back the forward they sold to Chelsea in 2014, but a move during the most recent transfer window became impossible when the club failed to have a transfer ban – imposed by FIFA as punishment for irregularities in the recruitment of minors – overturned.

Costa has been in Brazil since July and has refused to return to Chelsea training, accusing the club of treating him "like a criminal".

Conte laughed off the comments and said he would not pick the striker even if he made himself available, having signed Alvaro Morata from Real Madrid to become his first-choice forward.