A total of 2,534 votes were cast, about 12 percent of the district's nearly 21,500 registered voters.

Former District 3 City Councilor Paul Clancy announced just after 8 p.m. at Mr. Donahue's post-election party at City Lights Bar & Pub that Mr. Donahue defeated Ms. Claros by about 700 votes.

"Now it's just the beginning," Mr. Donahue told the crowd as he arrived to celebrate his victory. "Now the real work starts."

Mr. Donahue said that with the support of the neighborhoods and the people of the district, he will be a strong advocate. He said knocking on doors wasn't just part of the campaign.

"How can we build a better district?" he asked. "I'm going to continue those conversations at the doors, I'm going to continue talking with people, I'm going to continue working with everyone in this room, to make sure this district is the best district we can find."

After the results were announced, Ms. Claros thanked her supporters at her party at Nuovo on Shrewsbury Street, especially her "No. 1 door knocker," her 9-year-old daughter, Giselle.

"We put up a good fight," she said. The crowd cheered loudly when she declared, "This is not the last time you'll see me running."

Everyone in the room looked optimistically toward the 30-year-old single mother's next run.

"She knocked (on doors) from the day she announced until this morning," said Len Diana of Grafton, who said that voters react to her as an authentic person who does not skirt difficult questions.

Her campaign manager, Jim Knowlton, said he has already told the candidate that he would stand with her again for whichever office she decides to run for.

But while Mr. Knowlton said that Ms. Claros is considering a run for City Council or School Committee, state Rep. Ryan C. Fattman, R-Sutton, she he thinks she can go further.

"I think she's a great candidate," he said. "She should consider running for state Senate."

But Tuesday night's political stage belonged to Mr. Donahue, who campaigned as a young but experienced politician who would be able to advocate for ambitious projects in the district, including sewerage upgrades along the Route 20 corridor and development along Quinsigamond Avenue.

He quickly collected the endorsement of much of the local Democratic political establishment, and came out on top of a five-way primary battle last month. He will step into the unexpired term of Democrat John P. Fresolo, who resigned earlier this summer amid a House ethics investigation.

Ms. Claros' campaign platform was a mix of appealing to residents' frustration with taxes and advocating for small business development. She pledged to be a different kind of state representative, one who could casually go back and forth between Spanish and English, who wouldn't take per diem payments, and who railed against an increase in the gas tax. A state prison nurse, she continued to work throughout her campaign, and had hoped voters would identify with her working-class roots.

Ms. Claros' brother, Richard, was also at the event and said he was proud of his sister for running.

He gave her credit for "going against the grain" rather than with the crowd.

Sheriff Lewis G. Evangelidis, who supported Ms. Claros throughout the campaign, said that he admires her for running in such a difficult district.

"She was willing to take the challenge with a 9-to-1 Democratic majority," he said. "Boy, did she put up a fight."

Mr. Donahue said he had worked hard right until the end, and said the race was about local challenges and issues. Ms. Claros lost all 11 precincts, including her own, Ward 5, Precinct 2, where she polled 142 votes to Mr. Donahue's 209.

"It's not about partisan politics," he said. "It's about representing the district on Beacon Hill, but it's also about looking at our own neighborhoods."

The 16th Worcester District includes Grafton Hill, Vernon Hill, College Hill, the Massasoit Road area, Green Island, and Quinsigamond Village.