Inter run out 3-1 winners to extend their unbeaten run in Serie A to 20 games and to further their unbeaten record at home to 15 games in the Italian top-flight.
The hosts took the lead after Matteo Darmian’s cutback was turned in by Marcelo Brozovic, and midfielder Matias Vecino doubled the lead thanks to excellent hold-up play from striker Romelu Lukaku.
Edin Dzeko set up Henrikh Mkhitaryan just after the half-hour mark.
Mkhitaryan’s effort beat Radu to pull a goal back for Roma.
The visitors pushed on in the second half, with Dzeko being denied by the post, however, Lukaku’s late goal sealed the game, courtesy of a selfless assist from substitute Hakimi.
The result moves Inter onto 88 points – already their biggest haul since 2007 – while Roma, who will be coached by Jose Mourinho next season, are now guaranteed to finish no higher than seventh.
Inter, who ended up winning against Roma having already won the Serie A title too, next travel to fifth-placed Juventus on Saturday.
Roma remain in seventh place and they next host Lazio on the same day.