Long in the shadow of its powerful neighbor, the increasingly open, independent country finds itself unable to completely pull away.

MANDALAY, Myanmar — At the height of Western sanctions against the repressive Yangon government, Myanmar air force pilots traveled to China's Shaanxi province in the mid-1990s for training on recently acquired A-5 fighter jets.

Enthusiasm for the aircraft — and the nation's No. 1 patron — quickly faded, however, due to their unreliability. Former pilot Wunna Mar Jay recalls 20 crashes and numerous dead colleagues among those who used the Chinese version of the Soviet MIG-19. Most died in the cockpit, given a government policy at the time that families of those killed trying to eject received no death benefits.

The "Chinese weren't sincere, giving us their junk aircraft," says Jay, now a boxing promoter. "We called them 'flying coffins.'"

Myanmar's recent pivot from China toward the West, and a more open government, came as a surprise to many outsiders. In rapid succession, President Thein Sein's government suspended the $3.6-billion Chinese-built Myitsone hydroelectric project, held nominally free elections and released political prisoners, including opposition leader Aung San Suu Kyi.

In reality, though, anti-China sentiment had been building for years, say foreign academics, Yangon businessmen and former military officials. That apprehension grew even within the nation's armed forces, where officers believed Myanmar, also known as Burma, was being exploited by its giant neighbor.

As Myanmar becomes increasingly open, public protests have heightened over China's role in its affairs. "The Chinese are still in a state of shock," said Thuta Aung, head of Hamsa Hub, a business development firm in Yangon, also known as Rangoon. "In the past, they'd partner with the [Myanmar] military and do whatever they wanted as long as they put money under the table. Now villagers have more voice."

Yet even as Myanmar rebalances its foreign policy, it's unlikely to fully snub Beijing given China's proximity, growing international clout and the nations' historical relationship, analysts said. Though the Myitsone development was suspended, for instance, it wasn't canceled, and numerous other Chinese oil, gas, pipeline and resource projects continue apace.

"People are delighted with the dam suspension, but it only extends through President Thein Sein's term," said Suu Nget, a Mandalay writer. "We'll need to battle again in 2015."

Nor is China keen to walk away from Myanmar's promising consumer market and position astride key Indian Ocean shipping lanes. Even as Beijing warily watches growing U.S. and Japanese business ties, it remains miles ahead. Trade with China grew 46% in 2012 to $6.5 billion, according to official figures, while cumulative investment reached $14 billion.

In an attempted charm offensive early last year, Beijing sent an environmental vice minister to convince social and ethnic-rights activists of the merits of shared prosperity.

But the official, apparently unused to such spirited debate, appeared taken aback by vocal opposition over environmental issues he faced in a closed-door meeting, said Soe Win Nyein, a campaigner with the Green Hearts Environmental Network who was in attendance.

"We told him, if you keep pushing this, there'll be serious conflict between our two nations," the environmentalist said.

China has warily watched Myanmar's expanded freedoms, some say, fearful that its own people could make similar demands. "They want us to be stable, but not so democratic," said Ye Naing Moe, director of the Yangon Journalism School, which trains government officials on media skills. "When our government indicated it would end censorship, China wasn't very supportive."

Distrust of Beijing stems in part from fears, particularly in the north, of being overrun by China.

"No one likes the Chinese," said Yan Naing, 38, a Mandalay disc jockey. "It feels like an invasion."

Residents recall a 1984 fire that gutted downtown Mandalay and was followed by a government order to rebuild quickly using more expensive materials. Many had lost everything, even as Chinese citizens from neighboring Yunnan province appeared with ready cash.

"Burmese couldn't compete," said Kyaw Yin Myint, with the weekly Journal newspaper. "Many were forced to sell and leave the city."

The influx expanded after 1988, locals say, when a crackdown on democratic activists spurred Western sanctions. Myanmar fell further into China's arms, especially after Beijing used its U.N. veto to quash Western human rights resolutions.

Also drawing ire is the trafficking of women to southern China, either as sex workers or wives purchased to help rectify China's male surplus. China accounts for about 80% of human trafficking victims, Myanmar police reported in late 2012.

"The Burmese are very keen to get out of the embrace of the Chinese," said Morten Pedersen, a senior lecturer with the Australian Defense Force Academy. "Myanmar was angry with the sanctions, but it was never anti-Western. They have a traditional view of autonomy and saw they were losing that."