Sanchez was substituted late in Chile's friendly win over Colombia on Sunday (AEDT), with a dislocated joint causing damage to his peroneus longus tendon.
The 30-year-old travelled to Barcelona on Wednesday for a consultation with professor Ramon Cugat and it was decided the issue should be operated on.
A statement on Inter's official website read: "The visit [with Cugat] confirmed the diagnosis of the Inter medical staff and the decision was made to proceed with surgery on the left ankle.
"The operation was performed in the afternoon on the peroneus longus tendon and it went exactly as planned."
Sanchez, who joined Inter on a season-long loan from Manchester United in August, is expected to miss three months of action.
The ex-Arsenal star has made four appearances for Antonio Conte's side this term, scoring one goal in Serie A, though he was sent off later in the same match against Sampdoria.