The goals came in a 10-minute spell which straddled the half-time interval at the Etihad Stadium, rendering nearest rivals Liverpool's win against Newcastle academic.
With ex-Liverpool players Andy Carroll and Stewart Downing in their side, as well as Reds fan Kevin Nolan, West Ham did have the personnel to provide one last dramatic twist at the end of a compelling season.
But realistically - with City having a two-point advantage - that was always a long shot and there was never any hint that the nerve-jangling final-day drama of their title win two years ago would be repeated.
It was raining heavily at kick-off but the atmosphere was raucous and City approached the game with the confidence of a side that were comfortable and in control of their destiny.
City's top scorer Sergio Aguero was back in their side after injury but not at his sharpest, although on this occasion his brilliance was not needed.
West Ham did play more positively than the previous visitors to Eastlands, Aston Villa in midweek, but the occasions they threatened were still few and far between.
The hosts appealed unsuccessfully for a penalty early on after Mark Noble deflected a Pablo Zabaleta cross onto his hand.
Their first real chance came after David Silva and Aguero combined well on the edge of the box. Yaya Toure's initial effort was blocked before Silva volleyed over from a Zabaleta cross.
Zabaleta then wanted a penalty after going down under a challenge from Mohamed Diame before Aguero showed some nimble footwork to spark an attack from inside his own half.
The ball was worked across the field and Aguero tried to finish from distance but slipped as he shot and Adrian saved comfortably.
Nasri then had a good cross turned behind and Toure curled a shot narrowly wide as news filtered through that Liverpool had fallen behind in their game against Newcastle.
City maintained the pressure, with Aleksandar Kolarov forcing Adrian to tip over a powerful drive from distance.
Nasri finally broke through six minutes before the interval as he took aim from 20 yards and struck a powerful low shot which went in off the post after a possible touch from Adrian.
City fans then increased the volume significantly and Aguero glanced a header wide before Silva saw an effort deflected onto the bar off Carroll.
City truly got the party started four minutes into the second half when Kompany stabbed home from six yards after Edin Dzeko won the ball from a corner.
The City captain celebrated with unconfined joy.
West Ham did make a rare charge to the City end but Matt Taylor's mistimed shot bounced wide.
Aguero had two opportunities to extend City's lead but headed wide at the near post and then failed to connect in front of an open goal from a Zabaleta cross.
Aguero appeared to pick up another knock in the closing moments and he showed his frustration by bundling over Noble off the ball.
That sparked an unecessary scuffle between several players of both sides and Aguero was eventually booked, but it could not dampen City's celebrations.
They knew the job was completed and the hosts duly played out the closing minutes with little alarm to prompt a pitch invasion and jubilant scenes.