The 33-year-old Argentina international joined the Magpies in August 2018, from Swansea City, and made 89 appearances for the club, scoring twice and captaining the team on occasion in the absence of regular skipper Jamaal Lascelles.
A popular player with supporters, staff and team-mates, he struggled with injuries last term and played only twice under Eddie Howe, but the head coach has previously spoken of the former Napoli man's influence off the pitch, while he frequently demonstrated his abilities on it during his time on Tyneside.
And he has now signed for the La Liga side, who are currently 17th in Spain's top flight, on a permanent basis.
Fernández departs with the best wishes of everybody at Newcastle United and the club thanks him for his service.