The judge’s order was clear. She told Joseph Irby, who was facing a charge of domestic violence against his estranged wife, “Do not use, possess or carry any firearms, guns, weapons, ammunition or knives.”

But when Mr. Irby’s wife, Courtney, tried to turn his guns over to the Police Department in Lakeland, Fla., this month, an officer arrested her and charged her with armed burglary and grand theft of a firearm. The officer said she had illegally gone into her husband’s home and taken the guns. Because she walked out carrying them, the officer considered it armed burglary.

Ms. Irby sat in jail for five days before making bail and is now waiting to hear whether prosecutors will proceed with the charges.

The police officer’s decision to charge Ms. Irby has drawn rebukes from state legislators, lawyers and advocates for victims of domestic violence, who warned of the risk of punishing a woman who may have only been trying to keep herself safe.