The match kicked off at 1715 local time with the temperature around 32 Celsius and, although the pitch was almost entirely in the shade, the conditions clearly affected both teams.
After an entirely forgettable first half, Milan, still missing forward Zlatan Ibrahimovic with a calf injury, finally stirred into life after the break as Hakan Calhanoglu and Lucas Paqueta forced saves from Antonio Mirante.
The hosts broke through in the 76th minute when Franck Kessie's shot was saved at close range by Mirante and the ball rebound to Ante Rebic. His first shot struck the post but the ball came straight back to him and he scored at the second attempt.
Calhanoglu converted a penalty in the 89th minute to give Milan their second straight win since the restart of Serie A. They stayed seventh with 48 points, sixth behind fifth-placed Roma.
"The kickoff time made this a really tough match," said Milan coach Stefano Pioli. "We were looking for a victory against one of the top sides and we got it on merit. This win gives us confidence for the future. We have to grit our teeth and try to finish the championship well."
Roma coach Paulo Fonseca pointed out that Milan played their previous match on Monday while his team were in action on Wednesday, when they came from behind to beat Sampdoria 2-1.
"We gifted them the match with our mistakes," he said. "Teams are not creating many chances at the moment, but we are presenting them to our opponents and that makes everything more difficult."
As soaring temperatures across England forced the need for water breaks at all this weekend's Premier League games, it was City who were on fire at the Etihad as promoted Bournemouth were blown away
Goals from Danny Ings and Emi Buendia eased the pressure on Gerrard after a run of two wins in their previous 12 games dating back to last season
Spurs lost four times to Chelsea last season, including three defeats, two in the League Cup semifinal followed by one in the league, in January
French international striker Karim Benzema is the overwhelming favourite after being the architect of Real Madrid’s 14th Champions League title
The Aspire control and command centre will monitor all stadiums at once, as Qatar pulls out all the technical stops to keep an eye on the anticipated one million plus visitors from the moment they get off the plane to moment they leave
Kieron Pollard, Dwayne Bravo, Nicholas Pooran and Trent Boult are set to join ahead of the inaugural edition
Ahmed flew to Switzerland for what he thought was a training programme with his coach