SACRAMENTO, Calif. — Well, that’s one way to quit smoking.

A California woman who slapped a deputy to get arrested got her wish to go to jail in hopes she can give up her cigarette habit there.

Etta Mae Lopez pleaded no contest Thursday to smacking Sacramento County sheriff’s Deputy Matt Campoy earlier this week after he left the main jail at the end of his shift.

Campoy tells The Sacramento Bee that Lopez hit him and then told him it was intended to get his attention and hopefully help kick her habit because tobacco isn’t allowed in jail.

Authorities say Lopez waited all day for a uniformed deputy to come out to ensure she struck a law enforcement officer.

She pleaded no contest to misdemeanor battery and got 63 days jail, with credit for the three days she served this week.