MADRID — Over more than 20 years as a Spanish police commissioner, José Manuel Villarejo rubbed shoulders with politicians, judges, journalists, aristocrats and business leaders. He was decorated six times, including for helping Spain fight terrorists. Still, he was a relatively unknown figure to the Spanish public.

All of that changed 20 months ago, after he was arrested.

Today the onetime police hero sits at the center of a tangle of 10 investigations by Spanish prosecutors. They accuse him of having worked an illicit and lucrative sideline for years as a secret fixer for Spain’s rich and powerful, who they say used his services to spy on their rivals and smear their enemies.

With his trim white beard, dark glasses and cap, Mr. Villarejo, 67, is now one of Spain’s most recognized faces. But it is his voice that has sent shock waves through nearly every part of the Spanish establishment.

Mr. Villarejo secretly recorded his numerous dealings. Even as he sits in jail, snippets of those conversations are surfacing in the Spanish news media. The leaks have made it clear that the retired police commissioner may well have dirt on just about everyone who is anyone among Spain’s political and business elite.