A man accused of stalking Selena Gomez has pleaded not guilty.

Thomas Brodnicki -- who has a history of mental illness -- entered his plea at the Los Angeles Superior Court Thursday, and Judge Upinder Kalra set bail at $150,000.

The judge also granted a three-year protective order requested by the 'Monte Carlo' actress, which requires the 46 year old to stay at least 100 yards away from her, her family and her assistant.

Thomas must return to court on November 16 and could face a three year prison term if he is found guilty of stalking.

A temporary restraining order was ordered against him on October 13 after he had travelled from Chicago to Los Angeles to meet her, and had visited Selena's work place at least three times

Authorities were alerted to the situation after he had conversations with a therapist where he claimed he had talked to God who had told him to kill the actress.

The Los Angeles Police Department took the case "extremely seriously" because of his history of stalking.