MARAJ, Lebanon  For 25 years, Ali al-Jarrah managed to live on both sides of the bitterest divide running through this region. To friends and neighbors, he was an earnest supporter of the Palestinian cause, an affable, white-haired family man who worked as an administrator at a nearby school.

To Israel, he appears to have been a valued spy, sending reports and taking clandestine photographs of Palestinian groups and Hezbollah since 1983.

Now he sits in a Lebanese prison cell, accused by the authorities of betraying his country to an enemy state. Months after his arrest, his friends and former colleagues are still in shock over the extent of his deceptions: the carefully disguised trips abroad, the unexplained cash, the secret second wife.

Lebanese investigators say he has confessed to a career of espionage spectacular in its scope and longevity, a real-life John le Carré novel. Many intelligence agents are said to operate in the civil chaos of Lebanon, but Mr. Jarrah’s arrest has shed a rare light onto a world of spying and subversion that usually persists in secret.