Casemiro has put pen to paper on a new contract with Real Madrid until the summer of 2021.
The 23-year-old joined Los Blancos from Sao Paulo in 2013 and made 13 league appearances for the Spanish club before joining Porto on loan last summer.
The Brazilian international's form for Porto led to the Portuguese side launching a move for a permanent deal, but Real Madrid activated his buy-back clause to bring the midfielder back to the Bernabeu.
On Monday, alongside club president Florentino Perez, Casemiro extended his contract until June 2021.
The midfielder has won nine caps for his country.