Sanchez hobbled off in the 88th minute of a goalless draw in the friendly against Colombia in Alicante on Saturday.
Inter said that Sanchez underwent a consultation with Dr Ramon Cugat in Barcelona on Wednesday morning.
“The visit confirmed the diagnosis of the Inter medical staff and the decision was made to proceed with surgery on the left ankle,” the Serie A club said in a statement.
“The operation was performed in the afternoon on the peroneus longus tendon and it went exactly as planned.”
Medical tests in Milan on Tuesday revealed damage to a tendon in his left ankle and Chile coach Reinaldo Rueda said he expected the forward could be out for up to three months.
Sanchez joined Inter on loan from Manchester United this season, but has made just four appearances.
The 30-year-old was sent off in his first full start after scoring in a 3-1 win over Sampdoria.
Inter are second in the Italian league one point behind defending champions Juventus after seven matches.