BRIDGEPORT, Conn. — Joe Ganim made a stunning return to politics in 2015, when he was elected mayor of Connecticut’s largest city after serving seven years in prison for corruption during his first tenure as Bridgeport’s leader.

Now the Democrat is knocking on doors and greeting people in cars and on the streets in Bridgeport and other cities, hoping to pull off another improbable and even bigger victory — becoming Connecticut’s next governor.

Coming just shy of winning enough delegate support at the recent Democratic state convention to secure a spot automatically in the Aug. 14 primary, Ganim says he has nearly reached the goal of collecting signatures from roughly 15,500 registered Democrats to petition his way onto the ballot.

He’s delivering a message of liberal populism to urban voters, many of whom appear unconcerned by Ganim’s prison record and view him as someone who cares about them.

“We see it as someone coming up from being held to the bottom,” said Bridgeport resident Louis Lacend as he signed one of Ganim’s petitions last week. “He’s doing the best he can and people see that.”

Ganim, who was first mayor from 1991 to 2003, was sent to prison for steering city contracts in exchange for hundreds of thousands of dollars in expensive wine, custom clothes, cash and home improvements. He was released in 2010.

Nevertheless, the 58-year-old former inmate thinks his personality and message resonate with many voters.

“They want people that are in touch, that are not afraid to take on what’s perceived to be a kind of entrenched, kind of alienated establishment, whatever that is — Republican or Democratic,” he said.

At the state convention, the Democrats endorsed Ned Lamont, a wealthy 64-year-old businessman best known for defeating then-U.S. Sen. Joe Lieberman in the 2006 Democratic primary only to lose the general election to Lieberman after the senator ran as an independent.

Retired Greenwich business executive Guy Smith also is collecting signatures.

Gary Rose, a political science professor at Sacred Heart University in Fairfield, doesn’t foresee Ganim winning the primary. But Rose said Ganim could harm Lamont’s chances in the general election by casting a cloud of suspicion during the primary over the businessman, who likely won’t have the same level of appeal among urban minority voters.

“I think Ned is going to be scathed somewhat and I think that’s going to work to the advantage to whomever emerges as the Republican nominee,” Rose said. “Ganim’s base of support could potentially stay home.”

Ganim’s popularity was evident as he knocked on doors in the “Hollow” neighbourhood of Bridgeport, where he was greeted with hugs and requests for selfies. It’s one of the most ethnically diverse neighbourhoods in a city of more than 147,000, where almost a quarter of the population lives below the federal poverty line.

Ganim greeted voters with a “Hey, it’s Ganim” or “Hey man, you vote?”, then asking, “Will you sign my petition so they’ll let me run for governor?”

Some of Ganim’s supporters spoke openly about having served time in prison, their difficulty finding work and concerns about the city’s youth turning to drugs.

“I don’t think the neighbourhoods of Greenwich are exactly like this,” quipped Ganim, a not-so-subtle reference to Lamont and his wealthy hometown.

For his part, Lamont pledged at the state convention to help Bridgeport, where he has volunteered at one of the city’s high schools. Lamont promised to be on “Bridgeport’s side every day. Don’t worry about that. All of our cities.”

Bridgeport resident Cheyan Hines said she doesn’t know Lamont, but she does know Ganim — and she likes him. She remembers he once visited her church and how “everything was really, really good” in the city the first time he was mayor.

His felony record doesn’t bother her.

“Everybody has some hard times sometimes. And I, myself, have had a hard time,” she said. “So I think he can relate to people who’ve had that experience before.” She then signed his petition.