Apple CEO Tim Cook has been granted a temporary restraining order against an Indian-origin man who was allegedly harassing him and has shown up at his residence in Palo Alto twice.

According to reports, the man, named Rakesh “Rocky” Sharma, carrying a bottle of champagne and flowers showed up at Cook’s home. He returned a month later, entering the property’s gate without permission and ringing the doorbell.

CNET on Thursday reported that those interactions, along with phone calls, making what Apple describes in a legal filing as “threatening statements” led the company to request a restraining order this month against Rakesh Sharma, a 41-year-old San Francisco man.

As of now, Apple has got the temporary restraining order against Sharma, who goes by the name “Rocky” by a California court. The order lasts through March 3, when a hearing is scheduled, the report added.

The court has ordered Rocky to stay away from Cook’s residence in Silicon Valley, the CEO’s three security guards as well as the company’s Apple Park headquarters.

As per the filings, a man named Rakesh Sharma has also made threats against Cook and Apple, including sending disturbing voice mails.

Apple security specialist William Burns claims that Sharma’s harassment began on September 25, 2019, when he left a “disturbing” voicemail on “an Apple executive’s phone”.

The accused allegedly made another call around a week later. After that, Sharma’s behaviour “escalated,” Burns said, to attempting “to stalk Apple’s CEO by physically trespassing on the CEO’s personal property” on two separate occasions, the report added.

In another disturbing instance, Rocky entered Cook’s property through a closed gate without permission at around 10:30 p.m. on December 4 in an effort to deliver the flowers and champagne, a filing said.

“Shortly thereafter, Sharma continued to tag the Apple executive on his Twitter account, which included sexualised and inappropriate photos of Mr Sharma with reference to the Apple executive,” it said.

(With input from agencies)