The 27-year-old midfielder had been linked with a switch to Vigo for the last month and formally competed his move on Thursday.
Hernandez scored the only goal in the 1-0 win over Universidad Catolica in December that saw O'Higgins crowned champions of Chile for the first time in the club's history.
After starting out at Atletico Tucuman, the Argentina-born playmaker had spells at Racing Club de Montevideo, Defensor Sporting, MLS side DC United and Argentinos Juniors.
He also made a positive impression in his only appearance for Chile to date, scoring twice against Costa Rica in January.
Hernandez will be presented at Stadium Balaidos on Friday.