LAWRENCE — Police Captain Scott McNamara knows that several of Mayor William Lantigua’s close allies are facing criminal corruption charges, that the mayor slashed the police force and then faulted officers for rising crime. And McNamara certainly knows that Lantigua faced two recall campaigns, because McNamara backed them.

But now McNamara, president of the Police Superior Officers Association, is backing Lantigua, and he even donated $350 to the mayor’s bid for a second term.

McNamara is among a wave of unexpected supporters who have catapulted Lantigua to front-runner in the Nov. 5 election against Daniel Rivera, a city councilor and Gulf War veteran. In the preliminary elections last month, Lantigua received the highest number of votes, and the city’s firefighters endorsed him this month, though he had clashed with them, as well.

“The last year and a half has been great,” McNamara said by phone, emphasizing that his support is personal and that the union is not endorsing any candidate. “He’s been a big reason why.”

Josh Reynolds for The Boston Globe

Lawrence Mayor William Lantigua gave out stickers to supporters at a busy intersection.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

Supporters say the state’s first Latino mayor opened City Hall to the city’s Hispanic majority for the first time, paved roads, restored parks, and balanced the budget. But opponents say he sullied the city’s image and alienated investors in a poor city desperate for jobs.

The Rivera campaign contends that it could be a close race because slightly more than half the voters chose a candidate other than Lantigua in the preliminary election. Since then, Rivera has racked up multiple endorsements that could turn the mayoral contest into a nail-biter, including from US Representative Niki Tsongas, a Lowell Democrat, and three of the four losing mayoral candidates, including state Representative Marcos Devers.

“The better of the two candidates is obviously Dan,” said Frank McLaughlin, president of the Lawrence Teachers’ Union, which has endorsed Rivera. “It is painfully obvious to everyone in the state. Unfortunately, sometimes that’s not the case in the city of Lawrence.”

Lantigua’s historic election in 2009 electrified this former mill city of 76,000, where many residents, like Lantigua, are immigrants from the Dominican Republic who admired his rise from electronics technician to legislator and then mayor.

But controversy erupted immediately. At first, Lantigua refused to resign as state representative and collected two paychecks as Lawrence sought a state bailout for a $25 million deficit. Two former City Hall employees filed lawsuits accusing him of wrongful termination. The city’s police force lost about 40 officers to layoffs and budget cuts, only to see car thefts, homicides, and other crime soar.

State and federal investigations led to indictments of his close allies. On Oct. 8, Officer Pedro J. Lopez, a onetime Lantigua campaign supporter, was found guilty in federal court of bribery, obstruction of justice, and lying to a federal agent.

In September, Lantigua’s former campaign photographer was indicted on charges of
skimming money from the municipal garage where he worked and campaigning on city time. Last year, Lantigua’s former campaign manager, also the former deputy police chief, and the mayor’s former chief of staff were indicted on state corruption charges, including conspiracy and extortion. The three facing trial have pleaded not guilty.

Separately, the state attorney general is suing Lantigua for alleged campaign-finance law violations.

These controversies and others inspired failed recall campaigns to force Lantigua from office. New candidates were recruited to face off against him, which was not easy.

“People are afraid of William Lantigua,” said Zoila Gomez, an immigration lawyer who supported Lantigua in 2009 but now chairs Rivera’s campaign. “People have the perception that he’s unbeatable, and he isn’t.”

Opponents fear that the barrage of news stories has garnered sympathy for Lantigua, a charismatic politician who calls himself “the people’s mayor.”

Lantigua has not faced any charges, and he has denied any wrongdoing.

He referred specific questions about the corruption investigations to his lawyer, but Lantigua said he believes the attacks on his administration are motivated partly by racism.

Jeffrey Denner — Lantigua’s lawyer, who was with him in May when the mayor was called before an Essex County grand jury investigating the garage — said the mayor had no knowledge of any alleged wrongdoing in his administration.

“If he had done anything wrong, I respectfully suggest that [it] would have been brought to the citizens’ attention,” Denner said, adding that Lantigua has been under a microscope for years.

Though he will not talk about the investigations, Lantigua, 58, vaguely addresses the criticism through Spanish-language campaign jingles that refer to “pure made-up stories.”

On a recent Friday night, Lantigua’s popularity and political savvy were on vivid display amid the bodegas and beauty parlors of traffic-clogged downtown Lawrence. In a suit and tie, he stood at a busy intersection with about 50 supporters. They waved signs with Lantigua’s cellphone number on them and wiggled to the merengue and bachata jingles blasting from a speaker on his truck.

Supporters said they heard of the controversies but suspect they were racist attacks.

“I think those are all lies,” Jacquelin Cepeda, 27, said in Spanish. She said her parents and siblings voted for Lantigua in the preliminary elections and would again in November, 10 votes in all.

“He’s the only mayor who’s done something for Lawrence,” Cristóbal Encarnación, 72, a crossing guard from the Dominican Republic, said as he held a Lantigua sign. “Thirty-one years here, and I’ve never seen Lawrence like this. I can sit in the park. It’s decent. The streets are pretty. There’s no garbage.”

Rivera, who has a master’s in business administration from Suffolk University, said he rarely brings up the controversies surrounding Lantigua while campaigning, because some voters question the motives behind the allegations. Instead, he said, he offered to debate Lantigua without mentioning them.

“As citizens of this community, we deserve to hear what his plans are,” said Rivera, who is also bilingual and was raised in Lawrence by a single mother from the Dominican Republic. “We just don’t know what he’s going to do.”

But Lantigua dismissed the idea of a debate. “I debate my community,” Lantigua said in an interview. “I don’t have anything to learn from him.”

Lantigua says his biggest accomplishment as mayor is balancing the budget, but he said he has also repaired more than 125 streets, opened the 3.5-mile Spicket River Greenway, with paved bicycle lanes, and improved the Campagnone Common, the city’s main park, all work he said he would continue if reelected.

“What I’ve done is work from the first day,” Lantigua said. “We have worked as hard as we can, so that the people know, and have noticed, all the accomplishments that we have done.”

But Rivera says the mayor is taking credit for improvements largely financed by the state, which is closely monitoring the city. A state overseer reviews the budget, and in 2011 the state placed the failing school system into receivership.

Rivera pointed out that a state report had faulted Lantigua and the School Committee, which the mayor chairs, for ineffective leadership.

At Rivera’s campaign headquarters on Essex Street, volunteers hustle for votes in English and Spanish amid empty pizza boxes and posters listing his principles, which include “regain the trust of our city’s residents” and “repair our city’s image across the state.”

“He’s the only hope for Lawrence to be what it’s supposed to be, a clean and a proud city,” Milagros Montañez Santiago, a 57-year-old inspector at Raytheon, said as she dropped by Rivera’s campaign headquarters to pick up a bumper sticker. “I want the city that I loved back.”

To voters, Rivera touts his military service, civic involvement, and efforts to control spending as chairman of the City Council’s budget committee. If elected, he says, he would improve schools, hire dozens of police officers to improve public safety, and, he hopes, attract investment to create jobs.

Lawrence has the highest unemployment rate in Massachusetts, about 15 percent, according to the most recent figures from the state.

“We’ve got to get jobs,” said Rivera. “If we’re not a safe community, no one’s going to bring their businesses in here.”

Rivera has faced some union opposition because in 2010 he proposed reopening several contracts for cuts because of the deficit. The plan failed, and Rivera said he would not bring it up again. But many union members now feel that Lantigua is the safer bet.

McNamara, for one, said he backed Lantigua because he rehired every laid-off police officer, settled contracts with both police unions, and invested in cars and other new equipment for the department. And crime is down: Lawrence had only two homicides in 2012, compared with 10 in 2011.

The firefighters’ union echoed his sentiments. “Everything went pretty well with this current administration,” said fire Captain Eric Zahn, union president.

Critics say the union support for Lantigua is short-sighted. McLaughlin, the teachers union president, said teachers had also opposed Rivera’s plan to reopen contracts, though the plan would not have affected them. But McLaughlin said the teachers still support Rivera for mayor.

“It’s a bigger picture than our contract,” said McLaughlin. The teachers have not had a contract for four years, he added.

The wild card in the Nov. 5 elections are the nearly 25,000 people who did not vote in the preliminary election, some two thirds of registered voters.

One recent night, Rivera knocked on doors in a neighborhood with lower turnout than he had expected. He had no sound truck and no entourage. It was just Rivera, with a clipboard and a raft of voter registration forms.

To break the ice, he poked fun at his chubby waistline, then quickly launched into his top issues: public safety, improving schools, and creating jobs.

On the porch of a white house, Jennifer Abreu, 24, said she will vote for Rivera, in part because she wants better schools for her 2-year-old daughter.

“Rivera, definitely,” she said. “I think he brings a different perspective.”

One voter refused to give his name, but he told Rivera he hoped he would win.

“We’ve got to get people out, OK?” Rivera said.

“Don’t worry,” the man said.

Some point out that even if Lantigua wins this next election, he is limited to two terms under City Council rules. But supporters have suggested the council could change the rules and clear the way for Lantigua to run again, just like Mayor Thomas M. Menino of Boston.

On the campaign trail, Lantigua smiled at the suggestion, but he would not say whether he would support the idea.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.