After two weeks at number two, the US rappers knocked Joel Corry and MNEK’s Head & Heart from the top spot with 65,000 charts sales, including 8.5 million streams.
Cardi B’s previous best was the Bruno Mars collaboration Finesse, which climbed to number five in 2018, according to the Official Charts Company.
Newcomer Megan Thee Stallion reached number three in May with her viral hit Savage.
WAP is the second female-led single to reach number one this year, following Lady Gaga’s Rain On Me featuring Ariana Grande.
Lighter by Nathan Dawe featuring KSI was in third, while Mood by 24kGoldn featuring Iann Dior was in fourth, with Ain’t It Different by Headie One featuring AJ Tracey and Stormzy in fifth.
On the albums chart, London rapper Nines claimed his first number one with Crabs In A Bucket.
Nines, real name Courtney Freckleton, beat Metallica by some 2,000 chart sales, overtaking the metal titans in the past 24 hours.
He told OfficialCharts.com: “Thanks to everyone that put me in this position, I still can’t believe I’m number one – Finally won a golden boot.”
Metallica’s live album with the San Francisco Symphony, titled S&M2, took second, while All Rise by Gregory Porter took third.
Dance music duo Disclosure were at four with Energy, while Katy Perry’s latest effort, Smile, reached five.
The week also saw Lewis Capaldi’s debut album Divinely Uninspired To A Hellish Extent mark one million UK chart sales.