A Long Beach man was sentenced to three years in county jail for harassing his ex-girlfriend, who had obtained a restraining order to protect herself and her two children, one of whom he fathered, the Long Beach city prosecutor’s office announced today.

Joaquin Jensen, 35, was also ordered Tuesday to serve three years on probation, attend domestic violence classes and pay a $500 fine after being convicted of 11 misdemeanor counts of violating a restraining order involving his ex-girlfriend and her children.

The violations included contacting his ex-girlfriend—whom he had dated for nine months between August 2015 and May 2016—and sending emails to her, including one in which he wrote, “These people are crazy and it’s time to end all of them …” and another in which he wrote, “Now I am a ghost, I’ll haunt you and everyone involved until I’m sent to hell or heaven,” according to the city prosecutor’s office.

City Prosecutor Doug Haubert said Jensen repeatedly harassed the woman without any regard for the restraining order, and that the defendant’s emails “grew more and more disturbing.”

“If he was not arrested by police, there’s no telling how far he would have gone,” Haubert said in a statement.

Jensen could face up to nine additional years in jail if he violates a new 10-year protective order while on probation, according to the city prosecutor’s office.