A former Philadelphia police officer and ex-convict was sentenced to two years in jail after pleading guilty to sending hundreds of threatening text messages to an ex-girlfriend over a four-year period, the U.S. Attorney's Office announced Monday.

Bryan McGraw, 49, of Philadelphia, had previously pleaded guilty to a pattern of threatening behavior directed toward another police officer in Texas who had become romantically involved with a former lover of his, according to prosecutors.

In 2008, McGraw was a former Philadelphia police officer who had been removed from the force after being charged with a variety of offenses, including filing false reports, gun charges, tampering with evidence and aggravated assault. At the time, he was dating a woman who was still a member of the Philadelphia Police Department.

When the woman moved to Texas to join another police department, McGraw remained in Pennsylvania serving a state prison term that ran from 2011 to 2014. In 2011, The woman began to date another officer from a different Texas police department, a man identified in court documents as E.W.

In 2014, when McGraw was released from prison, he began to send text messages to E.W. using a disguised phone number. Prosecutors said McGraw used various techniques to prevent detection of his number and identity, including a pair of apps called MaskMyNumber and Mathrawk.

On Feb. 9, 2014, McGraw sent the following text — the first received by E.W.:

You do not know me and you do not want to know me I know all about you and your daughter. I am telling you this so do not think I am a joke. If you do not leave ‘my little baby’ [Name of female officer] alone you and your daughter will suffer. I have been watching and following you for two and a half years now. I know where you live and I know you use to be a cop like her so called fiance Brian who just got out of jail and I am going to make sure he goes back soon Do you want to join him. All the things you have been doing with her are going to stop. You f****** her will not happen no more.

Another text was sent to E.W. two days later:

Is [E.W. ‘s daughter] worth the p***y it would be a shame for her to be fatherless I know everything about your dumb ass.

FBI investigators said the texts from McGraw to E.W. continued from 2014-2018, totaling more than 600 messages during that span. The victim said he perceived the texts as "a big time threat" and found himself jittery every time he received a notification.

From November 2017 to March 2018, MaskMyNumber began logging the content of the messages sent by McGraw to E.W. The sender of the texts was partially identified using threatening names such as "wantstohurtyou@cellapp.us" and "comingforyou@cellapp.us."

McGraw also sent harassing text messages to two other officers during the period of the investigation, according to prosecutors.

At one point, authorities in Houston began investigating the text messages and interviewed McGraw, who misled investigators with a series of false claims about another alleged source of the disguised threats.

The investigation continued until March 2018, when Philadelphia police confronted McGraw and located his matching cellphone in a bucket of oily water behind his shed.

McGraw, who was on parole at the time of his arrest, pleaded guilty in May to sending the text messages. His sentence on Monday includes one year of supervised release, a fine of $1,200 and a $100 special assessment.

“This multi-year campaign of harassment affected innocent victims, including a minor child,” said U.S. Attorney William M. McSwain. “McGraw’s words and actions show a complete lack of respect for the law he once swore to uphold and a lack of concern about the safety of the victims he terrorized. This office will continue to investigate and prosecute those who weaponize electronic forms of communication to further an illegal purpose.”