Updated

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.

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.

"I'm moving forward," Gray told The Associated Press as he greeted voters outside a polling place. "Otherwise, it'll eat you alive."

Bowser greeted voters at polling places across the city, urging them to support Alexander and other council incumbents whom she considers allies. However, her efforts fell short in the Gray race and in a neighboring ward east of the Anacostia, where council member LaRuby May lost to Trayon White, a 32-year-old nonprofit founder and community activist.

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.