A Democratic congressional candidate in New York state said she supports a ban on some firearms, but admitted that she will never say so in public out of fear of losing the election.

"When I was at this thing today, it was the first table I was at, a woman said, ‘How do you feel about assault rifles?' And I said they should be banned," Tedra Cobb is heard telling a group of teens in a video posted Monday, the Washington Free Beacon reported.

"And I said, you know, people were getting up to go, to go get their lunch because it was a buffet, and I just said to her, 'I want you to know, Cindy, I cannot say that,” Cobb added.

"When I was at this thing today, it was the first table I was at, a woman said, ‘How do you feel about assault rifles?' And I said they should be banned." — Tedra Cobb

The candidate, who’s running against Republican incumbent Elise Stefanik in New York's 21st Congressional District, in the northernmost part of the state, was rebuked by others for her silence on the issue in the public.

Cobb explained that she cannot publicly come out in support of a gun ban as that will doom her election chances.

"And she said, ‘Well, I want you to,' and I said, ‘I won't win,'" Cobb said. "I said Moms Demand [Action] says, and Tricia Pleau [member of the gun-control group Moms Demand Action] said, ‘Do not say that you want an assault rifle ban because you will not win.'"

Cobb has a platform for addressing gun violence nationwide, including the expansion of universal background checks and banning of bump stocks. But none of her official proposals suggest banning any type of firearms.

The Republican Party jumped on the issue, issuing a stark attack on Cobb, calling her “wildly out of touch” and accused her of “lying to voters.”

"Tedra Cobb knows that she's wildly out of touch with the district, so she's desperately trying to hide her liberal agenda from voters," Chris Martin, regional press secretary of the National Republican Congressional Committee, told the Free Beacon.

“First, she was forced to admit that she raised taxes over 20 times [as a St. Lawrence County official], and now she's being exposed for lying to voters about her support for an assault weapons ban and taking guns away from law-abiding citizens,” he added.