San Francisco appeared poised to win a sixth Lombardi Trophy, which would have drawn them level with the New England Patriots and Pittsburgh Steelers as the NFL's most successful franchises, when they led 20-10 heading into the closing stages on Sunday.
However, Chiefs quarterback Mahomes – who had been intercepted twice by a swarming 49ers defense – threw late touchdown passes to Travis Kelce and Damien Williams to add to his rushing score in the first quarter.
Jimmy Garoppolo was then unable to respond when the 49ers quarterback got the ball back, Williams adding further gloss with a 38-yard rushing touchdown, meaning the Chiefs claimed their second Super Bowl and veteran Andy Reid finally won his first ring as a head coach.
Mahomes finished with 286 yards passing, and another 44 on the ground, while Williams had 104 rushing yards and Tyreek Hill 105 receiving yards.
It was another crushing Super Bowl loss for Niners head coach Kyle Shanahan, who was the Atlanta Falcons' offensive coordinator when they blew a 28-3 lead in losing to the Patriots three years earlier.
A nervous start at Hard Rock Stadium beset Mahomes and the Chiefs offense, who went three and out on their first offensive series for the third time this postseason.
San Francisco responded with a 10-play, 62-yard series that culminated in a Robbie Gould field goal.
The Chiefs offense would finally get rolling on a near seven-and-a-half-minute possession that featured a fourth-down conversion after Mahomes had fumbled out of bounds on a brutal hit from Jimmie Ward on third down.
Mahomes himself took the ball into the end zone, keeping it on an option play for a one-yard score and the game's first touchdown.
Three plays into San Francisco's next possession and the pendulum appeared to be swinging firmly in the Chiefs' direction when Garoppolo was intercepted by Bashaud Breeland.
The offense could only turn that into three points, though, and San Francisco made it 10-10 when a determined Kyle Juszczyk charged over having collected a short Garoppolo pass.
San Francisco might have gone into the interval ahead too, but a 42-yard George Kittle catch was negated, perplexingly, by a poor offensive pass interference call.
Another Gould field goal restored the Niners' lead at the start of the third quarter and then their defense stepped up, Fred Warner stepping in front of Hill to claim a Mahomes pass the play after the quarterback had recovered his own fumble.
That led to Raheem Mostert punching in from the one as the 49ers' lead was extended to 10 points.
Mahomes continued to be flushed out of the pocket, but he was not rushed on third-and-six early in the fourth quarter when a pass slipped through Hill's grasp and into Tarvarius Moore's hands for his first NFL pick.
It felt like the game was slipping away from Kansas City but Mahomes' 44-yard hook-up with Hill breathed new life into the Chiefs offense and they were back within one score through Kelce's one-yard touchdown catch.
Mahomes had now found his groove and on Kansas City's next possession Williams' quick-thinking saw him reach out and break the plane, a go-ahead score that was confirmed following a booth review.
Garoppolo got the ball back but the quarterback missed Emmanuel Sanders on a third down and was swallowed up on fourth down.
Williams scampered into the end zone again for the icing on the cake before Garoppolo was intercepted for the second time by Kendall Fuller to cap a miserable night for the Niners.