MADRID — This much has become clear in recent weeks: When Julian Assange, the WikiLeaks founder, was living in Ecuador’s embassy in London, someone was spying on him, recording his private conversations. The question is: Who ordered the surveillance?

Mr. Assange — in jail in Britain and facing prosecution in the United States — is scheduled to testify remotely later this month before a Spanish judge in a criminal case accusing a Spanish security company of eavesdropping on him illegally.

The Spanish court case has revealed a new set of secrets in the international saga of Mr. Assange, 48, showing that his claims of being spied on were not just paranoia or a publicity stunt. But as with all things related to someone who has been labeled a villain and a hero, a prophet and a crank, the revelations are subject to conflicting interpretations.

In Spain’s National Court, a public prosecutor and Mr. Assange’s lawyers have presented a raft of evidence that he was recorded while in the Ecuadorean Embassy, which they say violated his right to privacy. The material includes video recordings, reviewed by The New York Times, in which his conversations with visitors are audible.