Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Sen. Rand Paul, R-Ky., lost a vote Thursday on his effort to allow people to have a gun on their persons or in their vehicles while on Postal Service property as long they conform to state and local gun laws.

“What we don’t want is people to be caught up inadvertently who are trying to obey the law, and then all of a sudden are going to jail for something they never intended to do wrong and which is perfectly legal by their state law,” Paul said at Thursday’s meeting of the Senate Homeland Security and Governmental Affairs Committee.

His effort came in response to a federal court decision last summer that struck down a rule that bars firearms on Postal Service property. The Postal Service is appealing that court decision.

Some Democrats on the committee accused Paul of playing election-year politics.

“This about politics, it’s about 100 percent politics,” said Sen. Jon Tester of Montana. “This is about … what kind of ads are going to be available to be run and how the record will be distorted in those ads.”

After procedural maneuvering, Sen. Mark Begich, D-Alaska, got a vote on a separate amendment to allow people to have guns in the parking lot of a post office, but not in a post office itself.

Three Democrats in potentially close re-election races this November, Begich, Sen. Mark Pryor of Arkansas, and Sen. Mary Landrieu of Landrieu, all voted against Paul’s amendment and for Begich’s amendment.