The Publico daily, which broke the story, said the man was 63 and among his weapons were sniper rifles and a submachine gun. It added that suspect is an expert marksman and a regular in shooting competitions. He was working as a private security guard and illegally improvised some of his weapons, the report added.
It said he had apparently made the threats against Sanchez because he was furious at the prime minister's move to exhume late dictator Francisco Franco from his high-profile resting place near Madrid.
The man, who "wanted to kill the President of the Spanish Government", was detained in the northeastern city of Terrassa in Catalonia, the region's Mossos d'Esquadra police force said on Twitter.
"The arrested, who had an arsenal of weapons at home, is in prison," it added.
Catalonia's high court said he is suspected of "conspiring to wage an attack against authorities using weapons", without identifying him.
The man is also accused of making "serious threats," illegally owning a "cache of weapons, munitions and explosives," and of a hate crime.
A spokeswoman for the court told AFP the man had made threats online and was detained in mid-September.
"When his home was searched to check if the threats were real... an arsenal was found, which reinforces the credibility of the threats," she said, adding there were a lot of weapons.
She said he did not have an arms license.
The Spanish government said in a statement that the prime minister's security "had never been compromised."
Sanchez, who leads the Spanish Socialist Workers' Party (PSOE), has made exhuming Franco's embalmed body from the grandiose Valley of the Fallen basilica where he currently rests near Madrid one of his priorities since he came to power in June.
The issue has taken center stage in Spain and the government is due to announce Thursday its final arrangements to move the body.
Sanchez wants to move the former dictator's remains to a more discreet spot where it will be harder for Franco followers to pay homage.