The Brazilian playmaker will move from the Coppa Italia champions after four years at the club, but will remain in Serie A and continue his career at the Nerazzurri
The Giuseppe Meazza side were desperate to strengthen their squad after a number of disappointing results in the past few months and previously already brought in Danilo D'Ambrosio from Torino.
Hernanes was a firm favourite with Lazio fans since arriving at the club in 2010 from Sao Paulo, playing 154 matches and scoring 40 goals.
He has agreed to a contract with Inter until the summer of 2018, worth €2.8m (£2.3m) per season.
The Brazilian explained his decision to depart to Lazio's official radio station Lazio Style Radio: "I'm not leaving Lazio for money, my wife Erika knows the truth.
“Now I've made my choice. I would like to say thanks to all of you, the president, my team-mates and all the supporters.
“In my life I always tried to do my best, now I have the feeling it's time to make a change. It has been a hard night, I didn't sleep at all. I knew the supporters loved me, I couldn't imagine they did so much. I'll keep them in my heart"The 28-year-old played an integral role for Lazio in their Coppa Italia triumph last season and, as a result, around 200 Lazio fans protested the sale on Thursday at the club's Formello training ground- something which reduced the Brazil international to tears as he explained his desire to move on from the Italian capital side.
Inter currently sit fifth in the Serie A table with 33 points from 21 games.