LAWRENCE — With the narrowest of margins in this city’s hotly contested mayoral election, challenger Daniel Rivera declared late Tuesday that he had unseated the controversial and popular mayor, William Lantigua .
Preliminary results showed Rivera with 7,625 votes to Lantigua’s 7,565 — a margin of just 60 ballots.
“It’s close. It’s really close,” Rivera said in a speech inside City Hall, flanked by the coalition of rivals-turned-supporters who, he said, helped catapult him to victory. “But we won this election and we’re going to make sure that everyone knows that we’re going to defend every vote.”
Lantigua’s campaign did not concede, and rumors began circulating of the possibility of a recount.
City officials and Secretary of State William F. Galvin, whose office supervised the election, said ballots were sealed with duct tape inside a basement vault at City Hall and would be guarded by police.
“We just want to make sure the ballots are safe and that there is no question of their integrity in the event one of the candidates asks for a recount,” Galvin said. “It’s obviously a very contested situation there.”
Galvin said any recount could take more than a week.
Voters waited hours after the polls closed at 7 p.m. Tuesday — and hours after tallies were expected at 8:15 p.m. — as crowds gathered at Lantigua’s packed headquarters downtown. Supporters at one point erupted in cheers, flashing four fingers to signal the mayor had won another term of four years.
Late in the evening, however, Lantigua’s campaign expelled all but Spanish-language media from his campaign headquarters. Supporters stayed, including Melix Bonilla, his former campaign manager who is facing state corruption charges.
When Lantigua later left, he walked several blocks to a restaurant, hugged supporters, and ordered rum .
“The only thing I can tell you is that I love you all,” he said to reporters who had trailed him to the restaurant. Later, he asked reporters to leave. “It has been a long day,” he said.
Supporters said Lantigua will examine his options.
Lantigua had been considered a front-runner as Tuesday’s race began; in the September preliminary election, he captured 48 percent of the vote compared with 23 percent for Rivera. Both candidates worked intensively Tuesday, making phone calls in English and Spanish, knocking on doors, and chatting on social media.
But as the voting day came to an end, Lantigua’s voice was strained and he appeared subdued. Minutes before polls closed, he exhorted volunteers to keep working.
“There are 10 minutes left,” Lantigua said in Spanish, pointing at his wrist. “We can still move people to vote.”
“We are working on it,” a woman called out in reply.
Rivera, 42, a Gulf War veteran, won the endorsements of Senator Elizabeth Warren, Representative Niki Tsongas, the Lawrence teachers union, and three of the four candidates who lost in September. He pledged to improve public safety and schools and restore the city’s image to encourage investors to create jobs.
Tuesday, he urged younger voters like him, the child of an immigrant mother from the Dominican Republic, to back his campaign. He also appealed to 92-year-old Elizabeth Fallisi, who said she could not drive herself to the polls.
His campaign had offered her a ride, but Fallisi said she only wanted to be driven by someone she knew. So, Rivera offered to pick her up himself.
Lantigua, a 58-year-old former state representative, became the state’s first Latino mayor in a historic 2009 election. Lantigua’s election thrilled the city, but his administration soon descended into controversy. Lantigua initially refused to resign his state representative seat and collected two paychecks as Lawrence faced a $25 million deficit that required a state bailout.
He battled with the city’s Police Department and reduced the number of officers on the force, only to see car thefts, homicides, and other crime rise.
And some of his close allies were indicted in state and federal court. On Oct. 8, Officer Pedro J. Lopez, a onetime Lantigua campaign supporter, was found guilty of bribery, obstruction of justice, and lying to a federal agent.
Lantigua’s former campaign photographer, Justo Garcia, was indicted in September on charges of stealing money from the municipal garage and campaigning on city time. Last year, Bonilla, who had also served as deputy police chief, and the mayor’s former chief of staff, Leonard Degnan, were indicted on state corruption charges, including conspiracy and extortion. Garcia, Bonilla, and Degnan pleaded not guilty.
The state attorney general, Martha Coakley, is suing Lantigua in a campaign-finance case.
Lantigua, who has not faced any charges, denies any wrongdoing. He has said that he believes the attacks on his administration are motivated partly by racism.
Lantigua, who calls himself “the people’s mayor,” is beloved by many for paving roads, improving parks, and making City Hall accessible to the Latino majority. He won the endorsement of the firefighters union and some of his former critics in the Police Department.
Lantigua posted a campaign ad on Facebook Tuesday aimed at Spanish-speaking voters.
“Remember,” he said in Spanish, “I know you and you know me.”
Tuesday’s election was taken over by state officials because the first round of voting in September was plagued by complaints of poor organization and errors by poll workers.
Galvin had sent about 10 lawyers and observers to the city, including Spanish speakers, since Lawrence is 74 percent Latino. By midday, the state had fielded a few complaints that were mostly resolved. One poll worker was fired after he campaigned outside the polling place, officials said.
Galvin said polling largely went smoothly.
“There have been issues raised, but most of them have evaporated upon review,” Galvin said by phone before polls closed. “I’m comfortable that every procedure is properly being followed.”
Massachusetts Common Cause, a nonprofit watchdog, sent about 30 volunteers to Lawrence, the only city they dispatched volunteers to, said Pam Wilmot, its director.
Wilmot said they had received reports that polling places did not have enough signs identifying them as voting locations and of campaigns dropping off literature at the polls. But those problems, she said, were fixed.
The state oversight came as both candidates were battling for every vote in this immigrant city of 76,000 people, 36 percent of whom, like Lantigua, are immigrants, according to the census. Many, including the mayor, are from the Dominican Republic. Lawrence is also one of the state’s poorest cities.
The city has the highest unemployment rate in Massachusetts, about 15 percent, and in 2011 the state took over the public school system.