A federal judge has ruled that a U.S. Postal Service regulation barring firearms in its parking lots violates the Second Amendment in a case brought by an Avon man and a national gun rights group.

But Senior U.S. District Judge Richard Matsch said the Postal Service has a right to bar Tab Bonidy, who filed the lawsuit, from carrying his gun into the Post Office building itself.

Bonidy brought the suit along with the National Association for Gun Rights in U.S. District Court in Denver. The case was handled by Mountain States Legal Foundation. Bonidy has a concealed carry permit and routinely carries a firearm.

In July 2010, Bonidy’s lawyer sent a written inquiry asking if he would be prosecuted under the USPS regulation if he carried his gun into the Post Office or stored it in his vehicle in the public parking lot when picking up his mail, according to Matsch’s ruling.

Mary Ann Gibbons, USPS general counsel, responded that “regulations governing conduct on postal property prevent (Bonidy) from carrying firearms, openly or concealed, onto any real property under the charge and control of the Postal Service,” Matsch wrote.

Matsch said there is a collective interest in public safety that trumps individual liberty in certain circumstances.

There are good reasons for barring weapons within the postal building itself, Matsch said. “An individual openly carrying a firearm may excite passions, or excited passions may lead to the use of the firearm. Someone could also attempt to take the firearm from its lawful carrier and use it for criminal purpose.”

But there are no similar reasons to forbid Bonidy from securing his gun in a vehicle in the parking lot before entering the building, Matsch said.

In fact, he said, the ban is a violation of Bonidy’s Second Amendment rights.

“”The public interest in safety and Mr. Bonidy’s liberty can be accommodated by modifying the regulation to permit Mr. Bonidy to “have ready access to essential postal services” provided by the Avon Post Office while also exercising his right to self-defense.”

Tom McGhee: 303-954-1671, tmcghee@denverpost.com or twitter.com/dpmcghee