The 23-year-old made 14 appearances for the Toffees last season before going on loan to Sevilla in January.
This term, Ramirez has been an unused substitute in one of Everton's three Premier League games this term but was in the starting XI for Wednesday night's EFL Cup win against Rotherham United.
Manager Marco Silva admitted that he did not want the Spaniard to leave, but conceded that limited game time could have seen the player return to his native country to continue his career.
On Thursday night, Everton confirmed Ramirez's move to the La Liga side in a brief Twitter statement.
The former Barcelona player joined Everton from Malaga on a four-year deal in July 2017.