PHNOM PENH, Cambodia — It has been an eventful six weeks for Sivarak Chutipong.

When he left for work on Nov. 10, the 31-year-old Thai native was an anonymous expatriate who had lived and worked peacefully as an airport engineer in the Cambodian capital of Phnom Penh for seven years. In the weeks since, he has met prime ministers, been pardoned by a king, and seen his picture splashed across the front pages of newspapers, caught up in the latest round of feuding between his native country and his adopted home.

Sivarak was convicted of spying in a Cambodian court earlier this month after relaying the flight information of fugitive ex-Thai prime minister Thaksin Shinawatra to the Thai embassy in Phnom Penh. Thaksin arrived in Cambodia on Nov. 10 for an intensely controversial visit, the fallout from which has attracted international attention and dominated news coverage in Thailand and Cambodia ever since.

Never exactly role models for peaceful co-existence, relations between Thailand and Cambodia have been especially strained since last year, when disagreements over territory surrounding an 11th-century temple near the Thai-Cambodian border erupted in a series of military clashes that left at least seven dead. Neither country’s leaders have been shy about exploiting this antagonism for domestic political points, and Sivarak’s arrest and Thaksin’s visit allowed Cambodia to take up the nationalist offensive against the government of Thai Prime Minister Abhisit Vejjajiva, as officials in Phnom Penh accused Bangkok of orchestrating an espionage plot and disrespecting Cambodian sovereignty.

A bitter rival of the Abhisit administration, Thaksin is the only elected Thai prime minister to have served a full term in office, scoring overwhelming victories in 2001 and 2005. In 2006, however, he was ousted in a military coup and later indicted on corruption charges. He went into self-imposed exile last year to avoid a two-year jail term and has been globe-trotting ever since.

Abhisit was incensed by Thaksin’s arrival in Cambodia, the closest the former leader has come to his homeland since going into exile. While Cambodian Prime Minister Hun Sen has referred to Thaksin in recent weeks as his “eternal friend,” their relationship is evidently forward-looking; in 2003, when Thaksin was still in power, Hun Sen caused a diplomatic crisis by egging on anti-Thai rioters who subsequently burned down the neighboring country’s embassy and attacked the Phnom Penh offices of Shin Corporation, owned by Thaksin’s family.

Time, however, heals all wounds (or perhaps the more appropriate adage is “the enemy of my enemy is my friend”); in any case, Thaksin and Hun Sen used the November visit to showcase their amicability while lodging a steady stream of criticism at Abhisit right on his doorstep. Thaksin, despite his conviction, still harbors ambitions of returning to politics, accusing the current Thai leadership of “false patriotism” during his inaugural speech as an official Cambodian economic adviser.

Sivarak had the misfortune of being drafted into a leading role in this diplomatic drama, as Thaksin and Hun Sen charged that on orders from the Thai Foreign Ministry, the young engineer had stolen secret information that put Thaksin’s life in danger.

“If we did not act in advance then for sure at this time, at this hour, Thaksin would be dead or jailed in a Thai prison,” Hun Sen said of the case, cleverly omitting the fact that Thaksin’s arrival was broadcast live on local television that morning.

Despite protests that he was not involved in politics and that Thaksin’s arrival was public knowledge, Sivarak was found guilty in a one-day trial on Dec. 8 and sentenced to seven years in jail.

As images of Sivarak’s tearful mother were beamed out from the Phnom Penh courthouse, critics in Bangkok accused Cambodia of manipulating the case for political ends. These charges were amplified when, just three days after his conviction, Sivarak received a royal pardon that Cambodian officials said had been brokered by Thaksin. Sivarak’s mother, to the delight of the Thaksin allies in Thailand’s opposition Puea Thai party, explained that her family could not trust Abhisit to handle the matter in the face of his acrimonious relations with Cambodia.

Following his release last week, Sivarak was invited to Hun Sen’s Phnom Penh residence for a stage-managed event in which, as photographers and Puea Thai leaders looked on, the Cambodian premier greeted him warmly and presented him with a copy of the pardon.

Thaksin, believed to be spending most of his time in Dubai, flew back to Cambodia on the eve of Sivarak’s release and visited him in prison. In an impressive feat of doublethink, he told Hun Sen he considered Sivarak “a political victim of the Thai government,” according to local television reports.

Sivarak himself had little to say on the day he was freed, wearing a guarded expression as he played out his role in the political theater.

“I feel very happy that I have freedom again,” he said.