The 29-year-old joins the San Siro side from Genoa in a deal that sees Diego Laxalt go in the opposite direction
Ansaldi spent last season on loan at Genoa from Russian Premier League side Zenit and the Serie A club activated a release clause to make the move permanent.
However, it was widely expected the Argentina full-back would move on again, and he has already played for Inter in a pre-season friendly against Real Salt Lake.
A short statement on Inter's website confirmed the 29-year-old joins Ever Banega and Caner Erkin in making the switch to Roberto Mancini's side during the close-season.
Inter did not disclose the length of Ansaldi's contract, but Diego Laxalt, who spent last season on loan at Genoa, has moved in the opposite direction.