A judge handed down the sentence to 27-year-old Sean Paul Delacerda on Friday.

Delacerda was found guilty in April of felony charges of assault with a gun, kidnapping and false imprisonment by violence.

Orange County prosecutors say Delacerda was waiting inside the home of his former girlfriend when she arrived there last year. He accused her of cheating on him, then pulled a gun and demanded to read her email.

The former deputy then put a bullet in his gun, put it in his mouth, and pulled the trigger — misfire.

He then locked the woman in a closet to read her emails.

Delacerda’s attorney says his client suffered from depression and had been drinking and things went down in a very different way.