Franck Ribery gave a vintage performance for Fiorentina but it was not enough, as Inter snatched two goals after his late substitution.
Franck Ribery rolled back the years but Fiorentina were stung by a late Inter rally as Antonio Conte's side snatched a thrilling 4-3 win to launch their Serie A campaign.
Former Bayern Munich winger Ribery created second-half goals for Gaetano Castrovilli and Federico Chiesa as Fiorentina looked set to take the points at San Siro on Saturday, only for Romelu Lukaku and Danilo D'Ambrosio to strike late on.
A dramatic game saw Fiorentina lead early on through Christian Kouame, but Lautaro Martinez scored a majestic equaliser in first-half stoppage time and Inter were in front thanks to a Federico Ceccherini own goal soon after the break.
Ribery then began to run the show, first teeing up Castrovilli after a joyous run down the left, and then when his defence-splitting long pass fed Chiesa.
But with seven minutes remaining, Fiorentina took Ribery off, and Lukaku bundled in an 87th-minute leveller before D'Ambrosio thundered in a back-post header to take all three points
Inter's first competitive game since their Europa League final defeat to Sevilla began with them being caught cold in the third minute.
Cristiano Biraghi's cross from the left opened up the home defence and Kouame tapped in from close range after unselfish play from Giacomo Bonaventura.
Inter were awarded an 18th-minute penalty, but the decision was overturned after a video review, with Martinez shown to have been the player who made the first contact when he and Martín Caceres tangled.
Fiorentina were shaken in first-half stoppage time when Martinez ripped a 22-yard strike beyond Bartlomiej Dragowski and into the right corner.
Luck was then on Inter's side in the 51st minute when Martinez's shot from a couple of yards inside the left edge of the penalty area, heading well off target, was deflected in off Ceccherini.
Fiorentina grabbed a sublime equaliser five minutes later, when Ribery's dribbling at speed had Inter's defence backtracking urgently and the Frenchman's short pass released Castrovilli to find the bottom-left corner from 12 yards.
Ribery was at it again in the 63rd minute, roaming through midfield and threading a terrific ball that Chiesa clipped past Samir Handanovic for Fiorentina's third.
Dusan Vlahovic wasted a chance to give Ribery a hat-trick of assists, after the Inter defence were again drawn to the 37-year-old, whose timely release of the ball found his team-mate in yards of space. Vlahovic shot high and wide, and Fiorentina substituted Ribery in the 83rd minute.
Lukaku, who had wasted a string of chances, tucked home new signing Achraf Hakimi’s cross from the right four minutes later.
And it was cruel on Fiorentina when D'Ambrosio headed Inter's fourth a minute later, connecting powerfully with Alexis Sanchez’s deflected cross from the left.