A freshman Republican state lawmaker apologized Monday for introducing legislation that would scrap a state ban on registered sex offenders loitering near schools, day care centers and other places where children gather.

“In hindsight, this rookie mistake was silly,” Rep. Sam Moore of Cherokee County said in an extraordinary speech delivered on the House floor before he withdrew his bill. “I am mature enough to admit that. At the time, though, I believed that I was fulfilling a campaign promise to hit the ground running.”

In a series of speeches on the House floor, fellow Republican lawmakers blasted Moore and his legislation last week, calling the bill “disgusting,” “irresponsible” and “egregious.” House Speaker David Ralston of Blue Ridge told reporters Moore is not “representative of our party at all” and said voters in Moore’s district might reconsider their pick. Observers speculated the Republicans were moving quickly to insulate their party before the coming elections.

Moore said he did not intend to enable child molesters with House Bill 1033. He said he was instead trying to protect Fifth Amendment rights by eliminating what he says are discriminatory and vague state laws against loitering. In drafting the bill, legislative counsel discovered the same code section that applied to the loitering laws included a state law barring registered sex offenders from being near where children congregate. To ban loitering laws, Moore found, he had to strike the sex-offender statute. But other state laws allow school administrators to force someone to leave school property, he said, and if someone refuses, they’re trespassing.

Moore, who was sworn in Feb. 11, said he filed his bill without questioning the controversial language that legislative counsel included in it, believing no one else but fellow lawmakers would look at it. He said he was seeking guidance through the Legislature’s committee process.

“If I had known that the media would be looking at my legislation,” Moore told the House on Monday, “I probably wouldn’t have (introduced) any of my bills without additional consultation.”

Since he filed his bill, Moore said, he has received hundreds of angry emails, text messages and phone calls. Some, he said, were “quite threatening.”

“House leadership should have mentored a freshman representative who came in halfway through session,” said Moore, who won a Feb. 4 special election runoff to replace the late Rep. Calvin Hill of Canton.

“Not a single member reached out to me on HB 1033 prior to signing up to speak at the (House) well last Friday,” he said. “Those who spoke publicly aired what should have been a quiet, private, constructive conversation the night before.”

Moore received a smattering of applause after his speech. Later, a steady stream of Republican and Democratic House members approached him at his desk, patted him on his back and shook his hand.