Councilwoman Maria Quiñones-Sánchez declared victory in a tight race for the 7th district Tuesday, appearing to have fended off a close primary election challenge by state Rep. Angel Cruz and district ward leaders seeking to to unseat her.

Quiñones-Sánchez was winning by 500 votes around 10 p.m. when she thanked supporters at a celebratory event in the Northeast. Seventy-eight absentee votes had yet to be counted. If her lead holds, she would likely win in November given no Republican challenger.

After entering her election party to cheers of “Maria” and hugs, Quiñones-Sánchez told supporters, “I want to thank God because there was a lot of negativity in this campaign.”

“When people say that the party is not with me, that is not true. Because the people are the party,” she said. She thanked everyone who supported her campaign and told them they were more powerful than any force, “Particularly any mean evil-spirited force.”

“It’s hard to debate someone who doesn’t talk about policy,” Quiñones-Sánchez said. “It almost sounds as if I was running against a Latino Trump.”

Cruz did not respond to requests for comment and had not officially conceded as of late Tuesday.

The race was tense from the outset, with Cruz calling Quiñones-Sánchez a bully who couldn’t get along with others in the district and Quiñones-Sánchez describing him and his allies as corrupt remnants of the weakened Democratic machine. Four years ago, she had accused Cruz and ward leader Carlos Matos of voter fraud when Manny Morales unsuccessfully ran against her.

Quiñones-Sánchez and Cruz did not differ much on key issues — both support sanctuary cities and oppose Mayor Jim Kenney’s so-called soda tax, as well as a supervised injection site in the district.

But supporters at the polls Tuesday, said Quiñones-Sánchez had proven herself over three terms. Naomi Wildflower, 31, who supports the soda tax and calls for a supervised-injection site, said she was “not a huge fan” of Quiñones-Sánchez, but still voted for her.

“Ultimately, she’s supportive of sanctuary cities” and Prevention Point, the nonprofit that runs the city’s only needle exchange, Wildflower said. She said, conversely, Cruz had “a pretty awful legislative history."

Yvonne Torres Miranda, 58, said she voted for Quiñones-Sánchez but added that she wished the two candidates would do less mudslinging and focus more on the community. “They need to learn to work together," she said.

Other voters said they chose Quiñones-Sánchez because of her track record and handling of constituent issues.

Quiñones-Sánchez was the first Latina elected to a district seat when she won in 2007. She has won reelection twice without the support of the party and is seen as one of the most independent members of Council, and a possible future mayoral candidate.

She’s also been one of Council’s most productive. In 12 years, she sponsored small-business tax reform and ushered in programs to help poor residents pay off delinquent taxes and overdue water bills. She also sponsored the creation of the city Land Bank, to more efficiently sell vacant land, though it has been slow to take off.

In a city where Council typically votes in lockstep, Quiñones-Sánchez was among the few to vote against the soda tax and has been an outspoken critic, recently introducing legislation to potentially repeal it. Her North Philadelphia district has several bottling plants as well as some of the poorest neighborhoods in the city, which reap the benefits of the tax in the form of pre-K programs and renovations to parks and recreation centers.

Cruz had the backing of most ward leaders in the 7th District, who have long feuded with Quiñones-Sánchez. He has represented a part of the 7th district in Harrisburg for 20 years and campaigned on the need for a Council person who could work with ward leaders. He vowed, if elected, to give all leaders jobs in his council office. The district, with the highest poverty rate in the city, also has the lowest voter turnout.

Quiñones-Sánchez had said she feared that Cruz would engage in voter fraud to win the election. A little more than half of the fraud complaints fielded by the Philadelphia District Attorney’s Election Fraud Task Force Tuesday — about 18 of the 48 — were from polling places in the 7th District, according to Cameron Kline, spokesperson for the District Attorney’s Office. “But nothing surprising in terms of what we usually see,” Kline said.

Staff writers Tommy Rowan and Jesenia De Moya Correa contributed to this article.