Taylor Swift Fan Who Charged Stage Ordered to Mental Hospital

7/26/2016 12:30 AM PDT

Taylor Swift Fan Who Charged Stage Sent to Mental Hospital

EXCLUSIVE

The fan who tried to bum-rush Taylor Swift during a concert is going away for a long time, but not to prison ... TMZ has learned.

A judge ruled Christian Ewing incompetent to stand trial, and instead ordered him to spend up to 3 years at Patton State Hospital. The San Diego County D.A. says Ewing will remain there until he's ruled competent.

The judge also ordered medication be administered involuntarily, if necessary. 

As we reported, Ewing got into a nasty brawl with security after he rushed the stage at Petco Park last year -- breaking a security guard's rib.

When and if he's ruled competent, Ewing will face 2 felony charges -- assault and battery -- for the fight.