A scandal-tarred pariah to Virginia’s Democratic Party only five years ago, Joe Morrissey on Tuesday took a giant step toward returning to the General Assembly despite fierce opposition from his party’s leaders.

“It’s somewhat sweet that three governors campaigned against me,” said Morrissey, 61, as he celebrated with supporters at a Mexican restaurant in Petersburg after defeating state Sen. Rosalyn R. Dance (Petersburg) in the Democratic primary.

With no Republican on the ballot in November, Morrissey’s impending return to power is another astonishing turn for a politician and former prosecutor whose career has been defined by histrionics and incidents of misconduct.

As always, Morrissey, who is white, counted on support from black voters, who turned out in large enough numbers for him to overcome Dance, a well-funded African American incumbent backed by Gov. Ralph Northam (D), U.S. Sen. Tim Kaine (D) and former governor Terry McAuliffe (D).

Even before Morrissey declared victory Tuesday, Northam called to congratulate him, a gesture that confirmed Morrissey’s return from political Siberia.

“Has there ever been a Democratic candidate who was running in a Democratic primary and continued to criticize the party officials for their ‘anoint and appoint’?” asked Morrissey, alluding to his party’s establishment. “I did that continuously. I criticized them for deciding and determining who gets the job, who gets the slot.”

With Democrats and Republicans fighting for control of the General Assembly this year, Morrissey seemed to relish his newfound cachet. When asked by a reporter which party he would caucus with, Morrissey said he was receiving calls from both Democrats and Republicans.

“There’s one thing that I remember Governor Northam saying in his inauguration address,” he said. “ ‘We don’t come to the state Capitol, to Richmond, as Democrats or Republicans. We come as Virginians.’ It’s true. . . . Just say that.”

In 2014, Democrats pressured Morrissey into resigning from the House of Delegates after he pleaded guilty to contributing to the delinquency of a minor after prosecutors said he had sex with Myrna Warren, his then-17-year-old receptionist.

Morrissey, who was 56 at the time, subsequently married Warren, with whom he now has three children, all of whom were with him Tuesday night to celebrate. Instead of seeking to avoid reminders of the scandal, Morrissey showed off his wife and kids in campaign fliers that he distributed during an unrelenting schedule of knocking on voters’ doors.

Robert Holsworth, a retired Virginia Commonwealth University professor, said that Morrissey’s victory over Dance “is another example of the populist wave that has swept this nation.”

“He ran as someone who is completely anti-establishment, and he portrayed the incumbent as a creature of the establishment,” Holsworth said. “He was also successful at redefining himself as someone who can get up off the floor after a series of defeats.”

Morrissey’s influence in the Senate, Holsworth said, depends on whether Democrats overtake the Republicans’ slim majority or reach a tie in November.

“If it is what it is now — 21-19 — the Democrats won’t want him to be the face of the party; he will be a pariah,” Holsworth said. “But if it’s 20-20, the Democrats are likely to embrace him.”

If Morrissey finds himself courted by party leaders, it would be another astonishing turn for a man whom Democrats shunned after details of his affair with Warren emerged. He spent days at the General Assembly while sleeping nights at the Henrico County jail as he served a three-month work-release sentence.

Larry Sabato, director of the University of Virginia’s Center for Politics, said Democratic officials in recent days expressed no concern about Dance’s prospects and will now have to contend with Morrissey, “who has always been more liberal than conservative” but often operates with his own agenda.

“Mainly he’s the chairman of the Morrissey Party,” said Sabato, who was Morrissey’s professor when he was a student at the University of Virginia. “I never thought he was finished, because he has always tried to come back and he has the energy to do it. Joe is an in-your-face politician, and a lot of people like it.”

Touting himself as “Fighting Joe,” Morrissey has long cultivated support among African American voters, many of whom are familiar with his work as a defense lawyer and his political campaigns dating back to the late 1980s, when he was elected commonwealth’s attorney in Richmond.

He was elected to the House of Delegates in 2007, representing portions of Richmond and surrounding suburbs, and reelected four years later. But Democrats pressured him to resign after his guilty plea.

By then, he was well known for courting controversy.

His reputation as a fighter is partly rooted in a fistfight he had with another lawyer in a courthouse hallway in 1991. He lost his Virginia law license in 2003 for unethical and unprofessional conduct. He won the license back eight years later, only to lose it again last year, partly because of his relationship with his former receptionist. That decision is under appeal.

Morrissey also has a reputation for pressing on despite setbacks.

His first attempt at a political comeback was in 2016, when he ran for mayor of Richmond — a race he led in the polls until his campaign tanked after a female legal client accused him of making unwanted sexual advances.

Within months, he was eying his challenge to Dance.

“Morrissey is the Marion Barry of Virginia politics,” said Quentin Kidd, director of the Wason Center for Public Policy at Christopher Newport University, alluding to the District’s former mayor. “He’s the rebel on the ropes who everyone can relate to and wants to win.”

Myrna Warren, grandmother of Morrissey’s wife, praised the candidate for “his conviction, his determination.”

“He’s unstoppable,” she said, adding that Democrats who opposed him will soon regret their choice. “His rise is others’ demise.”

Later, during an interview with radio host John Fredericks, Morrissey said the success of his insurgent campaign means he will be politically independent when he takes office. “It’s so liberating to go into the Senate and not owe anybody anything,” he said, adding that former colleagues in the House “loved it” when they could vote their “conscience.”

“When I go in there, that’s exactly what I’m going to do. Without any IOUs to any special interest groups, and without any IOUs to any political parties.”