Yankees outfielder Brett Gardner on Monday scored a restraining order against a crazed fan whose long-running obsession with the slugger has landed in Bronx Supreme Court.

Gardner, 36, who was not in court Monday, filed a request last week for a protective order against Gina Devasahayam, who insists the two have a mutual love for each other and want to raise a family together.

Devasahayam’s claims were news to Gardner, who said in court papers Devasahayam, 46, has “harassed and menaced” him and his family since latching on to him in 2015.

Bronx Supreme Court Justice Eddie McShan granted Gardner’s request Monday, saying due to “the possibility of injury” and because Devasahayam “could be a danger to Gardner and his family,” he felt compelled to grant the protective order.

The judge gave her until Thursday to come up with sufficient evidence to change the ruling.

The decision, however, did nothing to dampen Devasahayam’s bizarre infatuation with Gardner.

“Our relationship developed on social media,” she told The Post outside the courtroom.

“Even though they say I’m delusional, I believe he could see it,” she said.

“The photo of him is where he has a ball in his hand and he’s scratching it. You know, balling means having sex and scratching also is sexual. That’s how you can interpret it.”

Devasahayam also claimed Gardner is in “a dead marriage” with his wife.

“I have seen his wife on social media,” she said. “She copies me. She copies how I dress, she copies my poses. She’s aware of it. It’s like I serve as his mistress and she’s his wife.”

Except that Gardner has never met her in person, he said in court papers.