The 25-year-old Portugal international joins the Hammers until the end of the season and becomes David Moyes' first signing since taking over as manager.
Mario arrived at Inter for a fee of around £35 million in the summer of 2016 but failed to deliver the standard of performances displayed at previous club Sporting.
The midfielder arrived in London on Thursday to undergo a medical and finalise terms on a move to West Ham, with the transfer being announced on Friday.
Mario, who will take the number 18 shirt at the London Stadium, said: "I am really happy to be here.
"It’s a really amazing experience to join this amazing team and I am just glad to be here. It was a fast move.
"I have spoken with everyone around the team and, for me, it is exciting to play in the Premier League. I spoke with the coach and for me, I am really happy to be training for an amazing coach, also.”
Mario joins countryman Jose Fonte at West Ham, both of whom played a part in Portugal winning the European Championship in 2016.
Upon the midfielder's loan move being revealed, Mario said that he had spoken to Fonte about the club and that his coversation was influential in agreeing a move.
He added: "Jose explained to me a little more about the club and also the song we have, I’m Forever Blowing Bubbles, and that, of course, it was really important for me to join West Ham!
"It’s a really historic club with an amazing stadium and amazing players. I am just trying to know a little bit more about the club every day and now I have some time to know more.”