Enrique Olivares, 65, tied up the wife and son of Luis Bárcenas, former treasurer of Spain's ruling Popular Party, and their maid, at their Madrid home in October, the court wrote in a judgement.
He wore a clerical collar and persuaded the maid to let him in by saying he could help secure the release of Bárcenas, who is in jail pending fraud charges that have embarrassed the government.
Once inside, Olivares took a revolver from his briefcase and threatened the captives, demanding they give him pen drives containing computer files that he said they had in the apartment.
"He added that by revealing said information in the proceedings which are under way against Mr. Bárcenas, he would bring down the government of the nation," the ruling by the Madrid Provincial Court said.
Olivares tied the captives' hands behind their backs but Bárcenas's son Guillermo managed to free his hands, headbutted Olivares and disarmed him. The maid ran for help at a bar where staff called the police.
The court ruling did not indicate any concrete link between Olivares and the scandals surrounding Bárcenas, which have centred on accounts and computer files the former treasurer handled.
It said Olivares "suffers from a personality disorder with paranoid characteristics" which caused "his capacity to act according to the law to be partially affected, but not eliminated".
Bárcenas was jailed last year pending an investigation into allegations that he held €47 million ($65 million) in secret Swiss bank accounts.
SEE ALSO: I go to Switzerland because I love skiing: The Local's in-depth profile of Luis Bárcenas.
The High Court is separately investigating the allegations of financing irregularities in the Popular Party, which span nearly 20 years.
In testimony in July, Bárcenas named current Prime Minister Mariano Rajoy among the PP officials who he alleges benefitted from undeclared payments from a party slush fund.
Rajoy was forced to reject calls to step down over the affair. He denied that he or other party figures received illegal payments.
The judges rejected calls by Olivares's lawyers for him to be acquitted on grounds of his personality disorder.
They convicted him of forced entry, kidnapping, threats and causing light injuries and sentenced him to a maximum of 18 years in jail, the ruling said.