Getty Composite

Taylor Swift ALLEGED STALKER UNFIT TO STAND TRIAL

Taylor Swift's alleged stalker will not be facing a criminal trial after being arrested multiple times outside her pad ... because prosecutors say he's just not up for it, legally.

According to the Manhattan District Attorney's Office ... David Crowe -- the man who prosecutors say has been lurking around Taylor's NYC home for a while now -- has been deemed unfit for trial based on the results of his psychological exam.

BACKGRID

We're told the criminal case against Crowe has been dismissed and he will be committed to the custody of the Office of Mental Health, where he will receive necessary treatment.

As we reported ... David was arraigned last month on stalking and harassment charges but was then set free, only to be arrested again 2 hours later after going back to Taylor's block.

John M. Mantel for Fox News Digital

Crowe's lawyers asked for a psych exam before a potential trial, and a judge agreed ... and now the results are in and he's being sent off to a mental health facility instead of facing criminal prosecution.

Taylor was in the Big Apple during Crowe's multiple arrests ... but now she's a world away on tour in Japan -- and soon, she'll be in Vegas for the Super Bowl ... distanced from this.

Considering this man is now going to be confined to a facility going forward ... ya gotta imagine she'll be breathing easier when she's at home in NYC -- although, this guy was just the latest person who's been obsessed with her and who came to her home uninvited.

Also ... Taylor's jets have been getting tracked in recent months -- another headache for her, and a major concern for her team -- who said the tracking amounted to a roadmap to her whereabouts, information that can obviously lead to danger when in the wrong hands.

TMZ Studios

On this front, though ... no more worries about Crowe -- he's going away for a long time.

We'll be talking all things Taylor on the new "TMZ Swift-Tea Podcast" -- available on all podcast platforms.

Click here for info about our online advertising practices.