AC Milan recovered from a goal down to win 3-1 at 10-man Catania thanks to a second-half double from Stephan El Shaarawy and a strike by Kevin-Prince Boateng who was sent off near the end of a lively Serie A clash on Friday.
The win, which was Milan's third in a row including the 3-1 defeat of Anderlecht in the Champions League earlier this month, moved them up to seventh place on 21 points, 11 adrift of leaders Juventus who host Torino in the Turin derby on Saturday.
However it was not without controversy as El Shaarawy's equaliser was scored from an offside position, punishing a Catania side who have already suffered bad decisions in their matches with Inter Milan and Juventus this season.
Catania, who stay ninth with 19 points from 15 games, took a deserved lead in the 10th minute through ex-Milan defender Nicola Legrottaglie, who thumped a header past Marco Amelia from a Francesco Lodi corner.
Massimiliano Allegri's Milan side huffed and puffed through a scrappy first half but did not create one decent chance. Had his shaky defence faced a more incisive attack, Milan could easily have conceded more goals.
One goalmouth scramble just after the half-hour mark saw the jittery Milan defence haphazardly pinging the ball around their own box under little pressure from any Catania players.
The first 10 minutes of the second period had more action than the first half, with Catania's Pablo Barrientos helping Milan's cause four minutes after the break when, having already been booked, he kicked out at Antonio Nocerino and was sent off.
Milan took advantage of the extra man with a controversial goal from El Shaarawy, who tapped home a Robinho flick-on from an offside position after 52 minutes for his 11th league goal of the season.
Catania were rocking and could have been behind a minute later when El Shaarawy looked to have been tripped in the box only to be booked for simulation.
Boateng did put Milan in front in the 57th though with a spectacular long-range strike that curled past the stationary Mariano Andujar after the midfielder was left free to shoot.
The result should have been beyond doubt with 11 minutes left when a quick break from a Catania corner saw Boateng presented with a golden chance to double his tally but he smashed the ball high over the bar with the goal at his mercy.
Allegri's team could have made it three in an eventful last minute in which Urby Emanuelson hit the post and Boateng was given a straight red card for ungentlemanly conduct.
It was left to El Shaarawy to curl home a phenomenal goal in added time with his 12th league goal of the season and confirm Milan as a contender for one of next season's European places.
Photograph: Dean Mouhtaropoulos/Getty Images
Boateng hat-trick fires Milan's winning comeback
Controversy over Robinho goal as Milan held at Catania
Allegri named Milan coach
Vilanova calm ahead of first 'El Clasico' storm
Cong red-faced! MP says leaders don't leave AC chambers