Lukas Podolski made an instant impact off the bench as Inter battled to a 2-1 win at nine-man Udinese to boost the club's European hopes.
Inter kept its hopes of Europa League qualification alive with a 2-1 victory against nine-man Udinese in a bad-tempered and dramatic encounter at Stadio Friuli.
Goals from Mauro Icardi and substitute Lukas Podolski either side of an Antonio Di Natale equalizer ensured Inter claimed all three points, but Tuesday's Serie A contest will be remembered for a number of flashpoints that led to two red cards.
Maurizio Domizzi was dismissed in the first half for two bookable offenses, and after Udinese had bravely clawed back into the match, Ghanaian midfielder Emmanuel Agyemang-Badu saw red for a bizarre protest at referee Gianluca Rocchi.
The win leaves Inter one point behind sixth-placed Fiorentina and while Udinese is almost certainly safe from relegation, it will be disappointed to have thrown away its chances of getting a result after working so hard to stay in the match.
Before the game, Inter coach Roberto Mancini said star striker Mauro Icardi was close to signing a new contract with the club, but the 22-year-old saw little of the ball early on, blazing his only shot at goal high and wide from 20 yards.
Hernanes was at the center of much of Inter's best play in the first half, and he began a neat passing move that saw Danilo D'Ambrosio supply Rodrigo Palacio, only for the striker to head straight at Orestis Karnezis.
Udinese's hopes of slowing Inter's ascendancy suffered a severe blow when Domizzi received a second yellow card following a reckless challenge on Hernanes, scything down the Inter captain when he was a long way from danger.
Inter was gifted an opener just 20 seconds into the second half when Danilo slid in late on Mateo Kovacic with a challenge that got nowhere near the ball. Despite furious Udinese protests, Rocchi pointed to the spot – a decision that replays suggested was justified.
Icardi tucked away the resultant spot kick for his 18th league goal of the season, but Inter's lead did not last long.
As Mancini barked orders at his players, Allan broke and played an inch-perfect pass to Di Natale, who shrugged off two defenders and side-footed coolly into the corner of the net to equalize. The goal took the 37-year-old level with Roberto Baggio as the joint sixth top scorer in Serie A history, with 205 goals.
The game turned again when Badu claimed he was tripped as Inter attacked, and then in a moment of madness flicked a hand in the direction of Rocchi's face in protest. Di Natale exploded at the Ghanaian, visibly furious at having seen his side's hard work getting back into the game so foolishly undone.
Mancini then made an astute substitution that proved decisive, sending Podolski on for Guarin.
Moments later, an Inter corner bounced out of the Udinese area to the feet of Podolski, whose first shot was blocked. He made no mistake in firing left-footed into the top corner at the second attempt.