Republican Dan Halloran defeated Democrat Kevin Kim for a seat on the City Council following a race that become increasingly contentious as the candidates accused each other’s campaigns of religious and racial discrimination.

Halloran, an Auburndale attorney, beat Kim, a lawyer who was formerly the deputy director of community affairs for U.S. Rep. Gary Ackerman (D-Bayside), by 53 percent to 47 percent in the race to replace Councilman Tony Avella (D-Bayside), who was first elected in 2001 but ran unsuccessfully in September’s Democratic mayoral primary.

“I’m ecstatic,” said Halloran at the Bayside eatery Sullivan’s Tuesday night. “This community saw past all the nonsense that came up in the race and voted on the issues. Overdevelopment is a problem in the district. Now there will be a councilman who will address this problem like Tony Avella, but with the tenor of [state Sen.] Frank Padavan.”

State Assemblyman Mark Weprin (D-Little Neck) bested Bob Friedrich, who ran as a Democrat in the primary, by 67 percent to 30 percent in the Council race to replace Councilman David Weprin (D-Hollis), who was defeated in his bid for city comptroller. In the contestfor the seat ofCouncilman John Liu (D-Flushing), who won the city comptroller’s race, Republican Peter Koo defeated Democrat Yen Chou by 49 percent to 45 percent.

Halloran’s victory followed an acrimonious race that became increasingly hostile during its final weeks.

Shortly after Kim won the Sept. 15 primary, the Queens Tribune ran an article on Halloran’s participation in a pre-Christian pagan religion known as Theodism. The Queen County Republican Party pointed out that the Tribune was founded by Ackerman and that its sister company was involved in Kim’s campaign.

In October, two volunteers for Kim filed complaints with the 109th Precinct that they had been harassed by a group of youths who threw a football at them, yelled racial slurs and referenced Halloran’s name.

On Oct. 26, a group of Queens Democrats, including state Sen. Toby Stavisky (D-Whitestone) and Councilman John Liu (D-Flushing), denounced a flier sent out by Halloran’s campaign that superimposed a picture of Kim over downtown Flushing and insinuated he would allow northeast Queens to become overdeveloped.

The following day, Halloran’s campaign staff accused Kim’s camp of an “organized effort” to tear down the GOP candidate’s signs in northeast Queens.

Voters at the polls Tuesday said they were put off by the race’s mudslinging, but stood behind their candidates.

“I voted for Kim because he is endorsed by Liu, who was my councilman and has a good track record,” said Bayside’s Pete Dario.

Josh Maryles, of Bayside, said he voted for Halloran.

“The reason why is I don’t know who this Kim is,” he said. “I think he’s being booked by developers.”

Poll workers at PS 41 on 35th Avenue said they had already counted more than 300 voters by 11:30 a.m., while workers at JHS 158 on Oceania Street had more than 200 voters by noon. The turnout at both sites was significantly larger than during September’s primary, they said.

Reach reporter Nathan Duke by e-mail at nduke@cnglocal.com or by phone at 718-229-0300, Ext. 156.