BOULDER, Colorado — Boulder’s newly enacted “assault weapons” ban is meeting with stiff resistance from its “gun-toting hippies,” staunch liberals who also happen to be devoted firearms owners.

Only 342 “assault weapons,” or semiautomatic rifles, were certified by Boulder police before the Dec. 31 deadline, meaning there could be thousands of residents in the scenic university town of 107,000 in violation of the sweeping gun-control ordinance.

“I would say the majority of people I’ve talked to just aren’t complying because most people see this as a registry,” said Lesley Hollywood, executive director of the Colorado Second Amendment group Rally for Our Rights. “Boulder actually has a very strong firearms community.”

The ordinance, approved by the city council unanimously, banned the possession and sale of “assault weapons,” defined as semiautomatic rifles with a pistol grip, folding stock, or ability to accept a detachable magazine. Semiautomatic pistols and shotguns are also included.

Current owners were given until the end of the year to choose one of two options: Get rid of their semiautomatics by moving them out of town, disabling them, or turning them over to police — or apply for a certificate with the Boulder Police Department, a process that includes a firearm inspection, background check and $20 fee.

Judging by the numbers, however, most Boulder firearms owners have chosen to do none of the above, albeit quietly.

“The firearms community in Boulder — they may be Democrats but they love their firearms,” said Ms. Hollywood, herself a former Boulder resident.

One longtime Boulderite who has openly refused to comply is Jon Caldara, president of the free-market Independence Institute, who writes a column for the Denver Post and hosts the public-affairs show “Devil’s Advocate” on Colorado Public Television.

“The question was, do I do this publicly or do it privately, and I’ve chosen to do it publicly because somebody has to,” Mr. Caldara said. “There will be thousands of people in Boulder living in the shadows, worried about somebody turning them in.”

What made him decide to take one for the team was the specter of the tolerance-espousing Boulder City Council cracking down on a maligned minority, namely gun owners.

“In this town that spouts tolerance for alternative lifestyles, that actually puts posters all over its buildings and schools about it, when it comes to a lifestyle they don’t like, there is no tolerance,” Mr. Caldara said. “So for me, this all works around the word tolerance. And tolerance means tolerating things you dislike, that you find scary.”

How many others are engaged in noncompliance? “Without a doubt, there are more than 342,” he said. “I think potentially there are thousands.”

The city council, which has been hit with state and federal lawsuits challenging the ban, took action in response to the tragic Feb. 14 shooting at Marjory Stoneman Douglas High School in Parkland, Florida, which left 17 dead.

“I’m proud that we’ve taken a stand and become part of the growing movement towards common sense gun control in our country,” said council member Aaron Brockett on Facebook.

City Attorney Tom Carr has acknowledged that enforcing the ordinance will be a challenge, telling the Boulder Daily Camera that “there’s no circumstance where we go door-to-door and ask people if they’ve violated the law.”

Still, Mr. Caldara, who has shared custody of his son with Down Syndrome and teenage daughter, said he’s worried about the consequences. Each violation of the ordinance carries a fine of as much as $1,000 and up to 90 days in jail.

“I don’t like this at all. I’m scared,” Mr. Caldara said. “I do not want to go to jail. I don’t want them to confiscate my guns. I’m scared s–less about what’s going to happen to my kids. The idea of my son being without his dad for three months is awful. I just want some damn consistency.”

Boulder spokeswoman Shannon Aulabaugh declined to comment on his noncompliance, citing his role as a plaintiff in the federal lawsuit filed by the Mountain States Legal Foundation.

Other Boulderites are making their objections known in different ways. A Boulder business owner provided Ms. Hollywood’s group with T-shirts and yellow car stickers with the message, “We Will Not Comply,” which have popped up on vehicles, guitar cases, even rifle bags.

A rally in April before the council’s vote drew more than 500 supporters to downtown Boulder.

“That was a neat protest because it really brought out people from Boulder,” Ms. Hollywood said. “People you would never expect to be gun owners were standing there, the gun-toting hippies, basically, saying, ‘Why are you guys doing this to us? We didn’t do anything wrong, and now you’re coming after us.’ “

The city has insisted that certification does not constitute gun registration — police issue paper certificates and insist they do not keep records — although Ms. Hollywood refers to it as the “‘not-a-registry’ registry.”

Given that the average gun owner possesses multiple weapons, she said the 342 certificates could have been issued to as few as two dozen residents. She knows one owner who certified four firearms, another who certified eight.

“Most of them are doing five to 10 firearms per person,” Ms. Hollywood said. “I’m pretty confident it’s somewhere between 20 and 50 people altogether.”