Taylor Swift's alleged stalker spent four hours loitering on her building's roof.

Mohammed Jaffar - who was arrested on March 6 for stalking and burglary after having allegedly followed the 'Bad Blood' hitmaker for months - appeared in Manhattan Supreme Court on Monday (12.06.17) for an arraignment hearing, and the court was told his obsessive behaviour escalated in February, when he was seen going to Taylor's apartment building in Tribeca, New York.

Prosecutor Caitlyn Jaile told Justice Laura Ward: ''The defendant was observed via video surveillance inside [Swift's] apartment building attempting to enter the actual apartment ... spending approximately four hours outside of the apartment and on the roof deck.''

According to documents obtained by the New York Daily News newspaper, Jaffar had called Taylor's management team almost 60 times in just two weeks in January in a bid to get in touch with her.

He then made his trip to her building on February 6, and returned on February 13, where he rang the 26-year-old pop star's doorbell continuously for an hour until he was asked to leave. He returned again the next day, where he again rang the bell, but was ordered to move after 45 minutes.

And the court papers allege he was outside the property again on February 15.

When asked to enter a plea, the alleged stalker said: ''Obviously not guilty.''

His brother, Ali Jaffar, accompanied him to court and revealed his sibling suffers from bipolar disorder but is now managing his condition better.

He said: ''He's taking his medication right now. He's getting better. The [prosecutors] should go easier on him.''