A disturbed, gun-owning stalker tried to break into Taylor Swift’s Beverly Hills mansion wearing a mask and rubber gloves Saturday and had a trove of alarming paraphernalia in his car, police said in court paperwork filed Tuesday.

Julius Sandrock, 38, was arrested on suspicion of felony stalking and released from custody Tuesday morning, online jail records said.

Cops raced to get a firearm restraining order after Sandrock told them he owns a .22 caliber handgun, a 9mm handgun and a .380 caliber handgun, the temporary retraining order obtained by the Daily News said.

Police said a search of Sandrock’s car turned up an empty gun holster, live rounds of .380 “Fiocchi” ammunition, latex gloves, black gloves, a knife, multiple masks “similar to the ones painters use,” a black half-face mask, one 9mm ammunition round, an empty box of .22 caliber ammunition and black rope.

Cops also found “psychologist paperwork” and prescription medications including oxycodone and the anti-depressant fluoxetine, the TRO petition signed by a judge Tuesday said.

“Respondent…