The city councilman who bungled his way into federal bribery charges is also a total bonehead in his kooky heathen religion — whose members wear medieval garb, make sacrifices to multiple gods and compete in combat games.

Dan Halloran (R-Queens) — who was arrested Tuesday as the suspected bag man in state Sen. Malcolm Smith’s alleged plot to buy his way onto the mayoral ticket — has been publicly flogged and lost a spear-throwing contest as part of his Theodish punishments.

Halloran converted in the 1980s from Catholicism to the pre-Christian Germanic religion, whose believers drink mead or whiskey from horns and dress like characters in a Renaissance fair.

He learned about their tough disciplinary code when he committed an undisclosed act against a female “thrall” — or probationary servant.

He was stripped to his waist, strapped to a tree and flogged with a belt 11 times.

PODHORETZ: BRIBED FOR SO LITTLE

NY PLAGUED BY PARTY STOOGES: BLOOMBERG

EXCLUSIVE: FBI QUESTIONING PEOPLE ABOUT ESPAILLAT’S COMMUNITY-GROUP FUNDING

‘PAYOFF’ PAIR TARGETED IN INSURE-SCAM SUIT

Fellow member Nick Ritter refused to discuss the episode, but said the punishment fit the crime.

“He was given a choice, “ Ritter said. “He was going to leave Theodism or stay and pay the piper.”

The then-married defense lawyer made his way up the Theodish ladder through the years and in 1997 was asked by “sacred king” Garman Lord to ditch his rank and join the splinter group Winland Rice.

Halloran wanted a rare exemption from the year of servitude as a thrall that the religion required.

A thrall is auctioned off to members for lucky pennies — those found face up on the ground — and then the slave goes through a boot camp studying Nordic poetry, chopping wood and serving beer.

“The deal they were making with Dan was he would be able to skip that,” said Ritter, 37, a steel-plant supervisor who tried to veto Halloran’s request. “It was a controversial move that they regret now.”

Halloran then plotted to “hive,” or form another splinter group.

To do so, he had to duel with Ritter in a treacherous game that involved chucking a 7-foot-long sapling tree spear at each other while 30 paces apart.

Halloran lost by a couple points.

“I didn’t hit him,” Ritter said. “But he missed a catch or dropped it a few times.”

Halloran got another pass, retained the rank of lord and still was able to hive an offshoot called New Normandy.

He also made enemies within the religion for lowering the membership bar.

“More people started entering New Normandy without a filter there,” Ritter said.

Halloran was also “trying to democratize” Theodism — and was outlawed.

“He was building a voting block to take over the higher leadership,” Ritter said.

Halloran continued to practice anyway with his New Normandy crew even after becoming a city councilman.

FBI agents arrested Halloran in a predawn raid on Tuesday on a raft of corruption charges,

He was caught on wiretaps allegedly bribing two city GOP bosses to get Smith, a Democrat, on the Republican mayoral ballot.

“You can’t get anything without the f–king money. Money is what greases the wheels — good, bad or indifferent,” he said on one recording.

Halloran faces up to 45 years in prison if convicted.

He also could face a “religious trial,” where he could be fined and thrown of the Troth — a Connecticut-based Theodish organization which the pol has been affiliated with for the past decade.

Halloran lists himself as “counsel” for the Troth on his LinkedIn page, but the group distanced itself from the pol in a statement.

“Mr. Halloran is currently officially recognized as an Elder and Clergyman of the Troth, but he has been neither active nor involved with our organization for several years … If Mr. Halloran is convicted on these charges, then established Troth disciplinary procedures will be enacted, as Troth clergy are held to a very high standard,” the statement said.

“Our High Rede (Board of Directors) are aware of the issues and are carefully monitoring Mr. Halloran’s status, for the protection and integrity of our organization.”

Halloran still has some religious backers.

“I will support him the way I’ve always supported him. I’ve been here since Day One,” said Halloran’s Theodish underling William McNamara.