Sacramento County Sheriff's Department via KCRA Authorities say Etta Mae Lopez slapped a Sacramento County, Calif., sheriff's deputy Tuesday, May 7, to kick her habit in a smoke-free environment — jail.

A woman who slapped a California sheriff's deputy this week in a deliberate attempt to be thrown in jail so she could stop smoking got her wish when a judge sentenced her to 63 days for battery.

The woman, Etta Me Lopez, 31, of Sacramento, waited outside the Sacramento County jail for several hours Tuesday for the first deputy to come along, Sgt. Jason Ramos told NBC station KCRA of Sacramento. When Deputy Matt Campoy happened to wander by, Lopez — who jail records list as just 5 feet, 1 inch tall — suddenly slapped him and, when he tried to restrain her, hit Campoy in the arm, Ramos said.

Lopez pleaded no contest to a misdemeanor charge of battery against a peace officer and was sentenced to 63 days in jail, records showed Friday.

Campoy told The Sacramento Bee that Lopez said "she knew that the only way to quit smoking was to go to jail because they don't allow tobacco in the jail."

"I've been telling everybody that I have a new Irish name: Nick O'Derm," Campoy told the newspaper.

Follow M. Alex Johnson on Twitter and Facebook.

Watch US News crime videos on NBCNews.com