Portugal defender Pepe has rejoined Porto on a two-and-a-half-year deal, 12 years after departing for Real Madrid.
The 35-year-old spent three seasons at the Estadio do Dragao, winning two league titles, before a decade at Real.
Pepe, who has been capped 103 times by his country, won La Liga and the Champions League three times each while in Spain.
He joined Turkish side Besiktas in 2017 but was a free agent after leaving in December.
His return to Porto sees him reunite with former Real Madrid team-mate Iker Casillas, with the defending champions six points clear at the top of the Portuguese Primeira Liga.