An overzealous Miranda Cosgrove fan has been ordered to stay away from the singer/actress for the next three years or face time behind bars.

The former child star obtained a temporary restraining order against Joshua Stockton last month (Sep14) amid allegations he bombarded her with Twitter.com messages, in which he threatened to kill himself. He is also alleged to have sent the 21 year old a photo of a slit wrist.

He returned to a Los Angeles courtroom on Thursday (09Oct14), when the protection order was made permanent, banning Stockton from contacting or going within 100 yards (91.4 meters) of the former iCarly star, who is currently studying at the University of Southern California, until 2017.

Stockton must also surrender any weapons in his possession, according to Tmz.com.