A Buffalo, N.Y. community activist who is well known locally for pushing for a highly restrictive 2013 gun control law has been arrested for — wait for it — carrying a gun illegally at a public elementary school.

The arrested gun-control advocate, Dwayne Ferguson, caused quite a scene at Harvey Austin Elementary School, reports local CBS affiliate WIVB.

At about 4:15 p.m. on Thursday, police acted on a pair of anonymous 911 tips. A battalion of cops quickly swarmed the school. The brigade included over a dozen squad cars, the SWAT team and K9 units. The Erie County Sheriff’s Air One helicopter and what appears to be an armored vehicle also turned up.

The school was immediately placed on lockdown. Parts of two streets were closed.

About 60 students who were still on campus participating in after-school activities were funneled to the cafeteria.

Cops searched the school room by room and would not let parents on campus until they were satisfied that no shooting threat existed.

Ferguson, 52, was at Harvey Elementary because he works as a mentor in an after-school program for disadvantaged students.

He said he frequently carries a pistol. He has a license but the license does not matter under the strict state law Ferguson helped pass.

Among much else, the 2013 law, deemed New York’s SAFE Act, made it a felony to carry a gun on school property, according to The Buffalo News.

While it had previously been illegal to carry a gun on school grounds, the new law bumped the crime from a misdemeanor to a felony in response to the Sandy Hook Elementary School shooting.

The community activist has claimed that he forgot he was carrying his gun in a felony gun-free zone he helped create.

Rev. James E. Giles, Ferguson’s friend and the president of Buffalo’s Back to Basics Outreach Ministries, vouched for this claim.

“I’m sure Dwayne went into the school not thinking he had the gun on him,” Giles told The Buffalo News.

Giles said Ferguson even asked police on the scene what was going on.

“Dwayne’s reaction was to get his kids — he had about 50 of them — and make sure they were safe,” Giles explained.

Ferguson was eventually busted when police were patting down the people at the school so they could evacuate. He was wearing the gun in a holster. Throughout the duration of the terrifying lockdown, the community activist never bothered to tell the cops that he was carrying a gun.

“He had opportunities,” local chief of police Kevin Brinkworth told the News.

“I will say he had no ill intent to harm these students,” Brinkworth noted. “I don’t know why he had it on him.”

Ferguson is the head of the Buffalo chapter of MAD DADS, a national group that opposes gang violence and illegal drugs. MAD DADS is an acronym for Men Against Destruction Defending Against Drugs and Social Disorder.

The father of three also belongs to Buffalo Peacemakers, a separate anti-violence group that stands athwart gang-related crime.

Still more, Ferguson is something of a professional vigilante in Buffalo. He can be seen patrolling local malls and city streets in an effort to stop gang violence.

Ferguson now faces two felony charges of criminal gun possession.

He faced his first court hearing on Friday, reports local NBC affiliate WGRZ. Prosecutors had asked Judge Jeanette Ogden to set bail at $10,000. However, Ogden allowed Ferguson to walk out of her courtroom on his own recognizance, citing his community involvement and his squeaky clean criminal record.

Ogden did order Ferguson to submit all of his guns to authorities and to stay away from Harvey Austin Elementary until his criminal case has been resolved.

Follow Eric on Twitter and on Facebook, and send education-related story tips to erico@dailycaller.com.