Marshall stepped on the gas in the seventh of the scheduled 10 rounds, with a couple of brutal body shots amid a flurry of activity which forced Rankin to take a knee.
While Rankin gamely rose to her feet, referee Phil Edwards waved the fight off as Marshall joined fellow Britons Chantelle Cameron and Terri Harper in becoming a world champion this year.
She said: "I'm over the moon. For months now, I've watched all the other Matchroom girls get their chances and grab them with both hands and there have been times when I've thought 'When is my chance ever going to come?'
"Here it did and I've certainly grabbed it with both hands."
This fight was initially supposed to take place a fortnight ago but was moved to Halloween when Marshall's trainer Peter Fury tested positive for coronavirus.
Rankin slipped to 9-5 and has now lost all three of her fights when a major world title has been on the line but Marshall has improved her record to 9-0, with seven wins inside the distance.
She added on Sky Sports: "I've had nine fights in three years and I've learned that sometimes it's not just about the fighting. But Peter's always said if you're good enough you'll get there."
The 29-year-old has her sights set on Claressa Shields, a two-time Olympic gold medallist who is 10-0 as a professional and holds world titles at middleweight and the division below.
Marshall handed Shields her only defeat to date at amateur or professional level after beating the American en route to winning the 2012 World Championships.
Marshall added: "The only reason Claressa got the belts is because she got there before me, not because she's better than me, I'll tell you now she certainly isn't and I know she doesn't want anything to do with me."