The 27-year-old former Real Madrid B player joined the Foxes as a free agent after leaving Sporting Gijon following three years of service, playing 140 matches.
Are you the next great English Premier League Fantasy Manager? Play our Match of the Week Fantasy Game, challenge your friends and win great prizes!
He failed to settle in the East Midlands, making just eight appearances this season, and after just six months in England has joined the Primera Division side on a three-and-a-half-year deal for an undisclosed fee.
The Madrid-born Hernandez, who can play on central defence or right-back, joins fellow defender Martin Demichelis in signing for the club during the January transfer window. He arrived in Spain on a free transfer last week.