By Christian Shepherd and Colin Packham

BEIJING/SYDNEY (Reuters) - A Chinese-born Australian writer detained by authorities in Beijing for suspected espionage has long been a divisive figure among overseas Chinese dissidents and activists.

To his supporters, Yang Hengjun is a dedicated democracy activist who believed that China's autocratic system would, with time, necessarily liberalize. His detractors say he had long since abandoned criticizing the ruling Chinese Communist Party in favor of protecting his personal and business interests.

Yang, 53, whose legal name is Yang Jun, was detained in southern China's Guangzhou while waiting for a transfer to Shanghai earlier this month, after flying in from New York.

He was taken to Beijing, where China has said the city's State Security Bureau is holding him under "coercive measures", a euphemism for detention, as he is investigated on suspicion of "endangering state security".

Yang's lawyer, Mo Shaoping, told Reuters his client was suspected of "espionage", and was being held under "residential surveillance at a designated location", a special detention measure that allows authorities to interrogate suspects without necessarily granting access to legal representation.

Although his recent writing has mostly avoid Chinese politics, Yang first became prominent in the early 2000s when he earned the nickname of "democracy peddler".

Before censorship of China's microblogs intensified, Yang's essays on topics ranging from Chinese nationalism to the fate of ethnic minorities in Tibet, made him a popular commentator. He also wrote a trilogy of spy novels set in China.

More recently, Yang had largely steered clear of issues deemed sensitive by the Communist Party, only occasionally writing about U.S. politics, and instead had thrown his energy into a "daigou" business, procuring overseas products for Chinese buyers.

His store on China's popular mobile platform WeChat sold U.S.-made luxury bags, vitamins, baby formula and watches.

An employee of the store, who declined to be named, said that Yang started the store at the request of his readers, who wanted to buy real and fairly priced goods. Asked what would happen to the store now, he said he was waiting for instructions.

"KEEPS TO HIMSELF"

For the last two years, Yang, who friends describe as an affable, jocular but academic figure, had been living in New York as a visiting scholar at Columbia University.

"He was quite aloof from politics and tended to keep his personal news to himself," Yang's former landlord, New York-based businessman Yi Gai, told Reuters.

"About 75 percent of his energy and time was spent on his daigou work," added Yi, who is also a friend of Yang's.

Another friend, who hadn't spoken to Yang in several months, said the Australian writer believed his views were not a challenge to China's rulers.

"He played within the system. He had never called for the bottom to rise up. He wants reform only," said the friend, who declined to be named for fear for his safety.

Feng Chongyi, an academic at the University of Technology in Sydney, who was himself detained during a 2017 visit to China, said he believed Yang's detention was related to his international connections.

Tensions have risen in recent weeks between China and some Western countries after two Canadians, a diplomat on unpaid leave and a consultant, were arrested in China on suspicion of endangering state security.

Those arrests were widely seen in the West as retaliation by China for Canada's arrest of Meng Wanzhou, a senior Huawei Technologies executive, on Dec. 1 at the request of the United States for allegedly violating U.S. sanctions on Iran.

Australian officials have called on China to handle the matter "transparently and fairly", but have downplayed the connection between Yang's case and those of the Canadians.

"He is well-connected in China and internationally. He knows high-profile people in the Communist Party and he believed that meant he could travel to China with relative impunity," Feng said.

POOR BACKGROUND

Yang came from a poor background in China, but studied political economy at Shanghai's prestigious Fudan University, according to his own accounts of his time there.

Yang had often told friends that, before his writing career, he worked for China's Foreign Ministry. But ministry spokeswoman Hua Chunying told Reuters that Yang had never been employed there.

He would also tell friends that he knew Wang Huning, the Chinese Communist Party's chief of ideology, while at Fudan, according to two sources.

Friends say he became an Australian citizen in the early 2000s.

Xia Yeliang, a former professor at Peking University who now lives in Virginia, said Yang was a controversial figure among China's overseas dissident community.

Yang was believed in recent years to have married a well-known nationalist blogger, Yuan Ruijuan, souring his reputation among overseas democracy activists, Xia told Reuters by phone.

At times Yang had said his spy novels, which were serialized on his website, were based on his abundant personal experience within the Chinese system, Xia added.

The novels pit China's spy agency against the CIA and FBI and include double-agents, clones, and a main character who, like Yang, wrote fictional spy novels and attended Fudan University.

Yi, the landlord and friend, said Yang "was not willing to keep in close contact with radical dissidents, and definitely wouldn't cooperate with them, so it's natural that radical dissidents would be suspicious and speculate about him".

Before Yang left for China this month, Yi and some friends met him and the topic of his security came up, but everyone thought he would be fine.

"It looks like we misjudged," he said.

(Reporting by Christian Shepherd and Colin Packham; Additional reporting by Philip Wen; Editing by Alex Richardson)