ZUMAPRESS.com / MEGA

“Abbott Elementary” star Tyler James Williams has been granted a temporary restraining order against a fan who drove 2,200 miles to meet him.

According to court documents obtained by RadarOnline.com, Tyler was granted a restraining order against the man identified as “John Doe” in the documents.

The man was ordered to stay 100 yards away from Tyler.

In his petition, Tyler said the man sent him “concerning” messages and he seems “unstable and is also delusional since he believes we have a relationship.”

In one message, the man wrote, “I’m not playing games with you here, my mind is playing games with me” and “Call me I can’t stop shaking.”

Tyler, 30, said the man drove 2,200 miles and showed up to his L.A. apartment complex on September 1.

“Once inside the building, he repeatedly banged on my door while asking me to open my door,” the actor said.

The man “continuously rang my ring doorbell at least 30 times over a 4-hour period. He also attempted to open a window adjacent to my front door,” Tyler continued.

The actor said his doorbell camera captured the man’s frustration with not being able to make contact. He was heard on camera saying, “I can’t believe I’m leaving and we didn’t get to talk. This isn’t f—ing fair.”

Tyler has not returned to his apartment since the day of the incident.

OConnor/AFF-USA.com / MEGA

There has been speculation surrounding Tyler’s sexuality for years. The “Everybody Hates Chris” actor condemned the speculation while showing support for the LGBT+ community.

“Usually I wouldn’t address stuff like this but I feel like it’s a conversation bigger than me,” he wrote on Instagram.

“I’m not gay; but I think the culture of trying to ‘find’ some kind of hidden trait or behavior that a closeted person ‘let slip’ is very dangerous. Overanalyzing someone’s behavior in an attempt to ‘catch’ them directly contributes to the anxiety a lot of queer and queer questioning people feel when they fear living in their truth.”

Tyler said he refuses to contribute to the gossip about his sexuality.

“I’ve been very clear about the intentionality I try to put into using my platform to push back against those archetypes every chance that I get. Being straight doesn’t look one way. Being gay doesn’t look one way.”

“Happy Pride to all of my queer and questioning brothers, sisters, and individuals,” he added. “I pray that you feel seen in ways that make you feel safe in the celebration that is this month. As an ally I continue to be committed to assisting in that where I can and helping to cultivate a future where we are all accepted and given permission to be ourselves.”