With 100 percent of precincts reporting, Bowser won 44 percent of the vote to Gray’s 32 percent.
Bowser, 41, who has served seven years on the D.C. Council, emerged as the leading alternative to Gray, who has been mayor since 2011.
A major donor pleaded guilty to illegally funneling nearly $700,000 into Gray’s campaign in 2010. The man accused Gray of collaborating with him in the scandal.
Gray has vehemently denied the donor’s claims and accused him of lying.
Bowser came out ahead of seven other challengers in Tuesday’s primary and will probably win the Nov. 4 general election in the heavily Democratic city.
The Washington Post notes, however, that council member David Catania (I-At Large) is also running in the race for mayor, as well as Green Party and Libertarian candidates.