Taylor Swift's stalker has been sentenced to six months in jail on charges of attempted burglary after he broke in to her New York apartment last year.

The 28-year-old singer was left terrified last March when Mohammed Jaffar entered her New York apartment building and was arrested for burglary, stalking and trespassing, but now, more than a year after his arrest, he has been sentenced to half a year in prison.

According to E! News, the Manhattan District Attorney's Office says that Mohammed pleaded guilty to attempted burglary in the second degree on Monday, May 7, and on Wednesday (16.05.18), a judge officially handed him his punishment.

In addition to his six months jail sentence, he has also been sentenced to five years on probation, where he has to continue mental health treatment in Michigan.

Mohammed was originally supposed to face trial in September 2017, but was found unfit to stand trial.

The New York District Attorney's office said at the time: "The case was called yesterday in Part 71 and the defendant was found unfit to stand trial, then placed in the custody of the New York State Office of Mental Health."

After Mohammed's arrest in 2017, he was held on $20,000 bail and the judge signed off on an order of protection against him.

According to the criminal complaint obtained by the publication, Mohammed allegedly wanted to meet with the singer and had previously tried to get in touch with her on multiple occasions.

For the 'Gorgeous' singer, Mohammed's sentence comes just one month after her Beverly Hills home was the subject of an attempted break-in by a rope-wielding stalker named Julius Sandrock.

According to reports at the time, cops came across "empty gun holster, live rounds of .380 'Fiocchi' ammunition, latex gloves, black gloves, a knife, multiple masks 'similar to the ones painters use', a black half-face mask, one 9mm ammunition round, an empty box of .22 caliber ammunition and black rope", inside his car.

Taylor was not at the property at the time of the alleged incident, and Sandrock, 38, was released from police custody two days after his arrest.