Partial returns Tuesday night showed a close race in the special election to replace New York Rep. Anthony Weiner, who resigned in June because of a sexting scandal.

At 11:23 p.m., with 42 percent of precincts reporting, Republican Bob Turner was ahead of Democrat David Weprin, 51 to 49 percent, WNYC Radio reported.

A Turner victory would be a shock to Democrats, who have held the 9th District, covering parts of Brooklyn and Queens, for decades without question.

A pre-election poll showed a six-point lead for Turner, a retired media executive with no experience in politics. The fact that he is even competitive in Weiner's district, which has never elected a Republican, shows how disillusioned even solidly Democratic voters have become with their party's leadership, and Republicans framed the election as a referendum on President Barack Obama's performance.

It wasn't planned that way, but this is the only nationally contested election on the federal level, so it is, in a way, a referendum on President Obama's policies, Turner said Tuesday.

Weprin has campaigned on several positions, including protecting Social Security and Medicare, that have strong support in the district, and he has attempted to link Turner to the increasingly unpopular Tea Party.

But he also lost some support among the district's large Orthodox Jewish population -- which he might have expected to win easily, since he is himself an Orthodox Jew -- because he voted for same-sex marriage in the New York Assembly, and because some Jewish voters oppose Obama's policies toward Israel, NPR reported.

Democrats are clearly worried, and big names like Bill Clinton and Gov. Andrew Cuomo campaigned for Weprin in the days leading up to the election.

But Weprin said he was confident that the district's well-established Democratic machinery would be able to turn out more voters than the Republicans.

We have a lot of people with us, and I think we are going to pull out the votes, he said, as quoted in the Seattle Post-Intelligencer. I think the polls are not going to reflect who's going to come out to vote.

Weiner -- who had served in the House of Representatives since 1999 and earned a reputation as one of the most outspoken liberals in Congress -- was forced to resign in June after admitting that he had sent lewd photos to a woman on Twitter and engaged in inappropriate online relationships with six women over the course of three years.