WASHINGTON (AP) — Two years after he lost his bid for a second term as District of Columbia mayor amid a federal corruption probe, Vincent Gray has assured himself a return to elected office in the nation’s capital.

Gray, 73, won a Democratic primary Tuesday for a D.C. Council seat representing his home ward, defeating incumbent Yvette Alexander. No Republican or third-party candidates have filed to run for the seat in the heavily Democratic ward.

Gray defeated Democrat Adrian Fenty in 2010 after the brash young mayor alienated many voters, particularly African-Americans.

Allegations of corruption in Gray’s campaign began to surface just weeks after he took office, and the U.S. attorney’s office launched an investigation that ultimately led to six guilty pleas from people who helped Gray get elected. The probe revealed that an influential businessman poured $660,000 in illegal cash into the campaign, and prosecutors said in court that Gray knew about the illicit funding scheme. Gray denied all wrongdoing, and the investigation ended in late 2015 when prosecutors decided not to charge him.

On the council, Gray could be an antagonist to Mayor Muriel Bowser, who defeated him in the 2014 Democratic primary after painting him as corrupt. He refused to endorse her after her victory, and the two are not on speaking terms. However, their differences are rooted more in personality than politics: both are mainstream Democrats with liberal views on social issues and strong ties to the city’s business community.

Two other Bowser-backed incumbents also lost their seats as voters rejected efforts by the mayor and her supporters to stack the council with allies.

Gray’s home ward is east of the Anacostia River, a section of the city that struggles with crime, poverty and unemployment. Voters there appeared to be skeptical of the investigation even in 2014, when Gray defeated Bowser in the ward by a 2-to-1 margin.

“It was like a cloud that was over his campaign that was unnecessary,” said Maureen Turner, 48, who voted for Gray on Tuesday. “I thought he was a good mayor.”

Gray remains bitter about the investigation, particularly the timing of public statements by prosecutors that led many observers to believe he would soon be charged. But he said this year’s campaign has allowed him to regroup and focus his energies on public service.

“It feels good to be able to put that into the history books,” Gray told reporters after declaring victory.

Bowser greeted voters at polling places across the city, urging them to support Alexander and three other council incumbents. But voters took little stock in the mayor’s endorsements. In the city’s other ward east of the Anacostia, council member LaRuby May lost to Trayon White, a 32-year-old nonprofit founder and community activist.

And in the night’s most surprising result, longtime at-large council member Vincent Orange lost to Robert White, an attorney and former congressional staffer.

While campaigning on Tuesday afternoon, Bowser told The Associated Press she was confident she’d be able to work with whoever won in the primaries, noting the candidates’ ideological similarities.

“Almost all the things we do on the council, there’s almost unanimity,” Bowser said. “Substantially and policywise, we’re very similar, the lawmakers and the executive.”

Gray’s comeback evokes memories of the late Marion Barry, a Democrat who was elected to the D.C. Council after he was caught smoking crack cocaine in an FBI sting operation during his third term as mayor. Barry used that victory as a springboard to return to the mayor’s office.

In the presidential race, Hillary Clinton defeated Bernie Sanders in the nation’s final primary, which became largely meaningless last week after Clinton secured enough delegates to clinch the Democratic nomination. Clinton and Sanders met Tuesday night amid speculation about when and under what conditions Sanders might endorse the former secretary of state and first lady.

Council member Brandon Todd, a staunch Bowser ally, held onto his seat. Two other District political stalwarts ran unopposed: Democratic Delegate Eleanor Holmes Norton, who represents the District in Congress, and Democratic Council member Jack Evans.

___

Follow Ben Nuckols on Twitter at https://twitter.com/APBenNuckols . His work can be found at http://bigstory.ap.org/content/ben-nuckols.