WASHINGTON (AP) — Myanmar was supposed to turn away from China and toward the West when the United States helped the Southeast Asian country make the transition to a civilian government after five decades of military rule.

The opposite is happening: The new government is failing to attract Western investment and Beijing is on a charm offensive. China is offering economic and political support and a relationship free of the human rights concerns straining Myanmar's ties elsewhere.

Myanmar, also known as Burma, was a foreign policy success for President Barack Obama. He helped coax its powerful generals into ceding power by normalizing diplomatic relations and rolling back years of economic penalties, paving the way for Nobel peace laureate Aung San Suu Kyi to take power after winning elections.

Suu Kyi's historic struggle for democracy still evokes deep respect in Washington and Europe, but running a civilian government for the past 14 months has exposed her inability to bring peace to a country riven by ethnic conflict. She also has struggled to produce economic growth, hobbled by a lack of control over the nation's still powerful military and a rigid management style.

Finding less love among the Western democracies, Suu Kyi is cautiously embracing closer ties to China.

"Amid the unpredictable challenges of this democratic transition, Western influence on Burma is waning, while Beijing is becoming more assertive," Myanmar's Irrawaddy news website said in an editorial.

Recent weeks have seen a flurry of China-Myanmar engagement. Suu Kyi met Chinese leader Xi Jinping at a Beijing summit in mid-May, her second visit there in the past year. Earlier, Myanmar's titular president, Htin Kyaw, received a six-day state visit. Suu Kyi's trip ended with an agreement with China to create an economic cooperation zone as part of the Asian giant's "Belt and Road" initiative to connect with Asian and European markets.

Last weekend, Myanmar's Navy held drills with Chinese warships. China's state-run Global Times said the military cooperation demonstrated "political trust."

That trust was expected to develop between Suu Kyi and the U.S.-led West.

Myanmar's enduring fear of being dominated by its much larger neighbor, China, was one reason it improved ties with the United States in the first place. The Obama administration seized the opportunity while trying to "pivot" American foreign policy focus to Asia, hoping deeper relationships with its booming economies would provide the U.S. long-term strategic and economic advantages.

Derek Mitchell, the former U.S. ambassador who spearheaded Obama's Myanmar rapprochement, said China was "stunned" when the country reached out to the West between 2011 and 2015. China is now making up for lost time, and capitalizing on President Donald Trump's reduced attention for Myanmar, he said.

"It gave an opportunity for China to say, 'See we're on your border and we're here to stay. You can't count on the Americans,'" Mitchell said.

Katina Adams, a State Department spokeswoman for East Asia, said the U.S. remains committed to consolidating democracy in Myanmar and is helping the government address many inherited challenges, including the disproportionate role of the military in the economy and the need for responsible investment.

Trump has started to reach out to Southeast Asian leaders, praising Philippines' president Rodrigo Duterte for his deadly war on drugs and inviting him and Thailand's prime minister, who took power in a coup, to the White House. In the coming week, Trump is hosting communist Vietnam's prime minister.

Trump has yet to speak with Suu Kyi.

For two decades, while Myanmar was under military rule, U.S. administrations and influential lawmakers adored Suu Kyi. Obama helped her transformation from political prisoner to national leader, fostering democracy on China's doorstep. Republicans and Democrats promoted the change as a victory for U.S. interests and values.

China, which sees Myanmar as a land bridge to the Indian Ocean, saw a strategic setback.

Yun Sun, a China expert at the Stimson Center in Washington, said Chinese policy experts even characterized it with a proverb: "The cooked duck flew out of the window."

She said the proverb's meaning is clear: "Myanmar was already in our pockets but somehow the Americans stole it from us."

But Trump may have little political incentive now to prioritize U.S. ties with Myanmar.

"What are left now are the problems," Sun added.

—sluggish economic growth. Washington has increased foreign aid and encouraged American investors last September by lifting the remaining economic sanctions other than on arms sales. But the moves haven't spurred economic activity in one of Asia's last untapped markets.

Myanmar ranks 170th out of 190 nations in the World Bank's ease-of-doing-business rankings, and third-worst globally for contract enforcement. Foreign investment dropped almost a third between April 2016 and April 2017, according to Myanmar government figures, with no new U.S. projects.

—human rights. Western nations in March backed a U.N. fact-finding mission on reported atrocities against Myanmar's downtrodden Rohingya Muslims. Suu Kyi opposed the idea, tarnishing her international reputation.

—ethnic conflict. Suu Kyi has prioritized resolving Myanmar's decades-long wars between the army and ethnic rebels, with little success. She tried again this week, bringing rebel groups together for talks with the government and military. China has leverage with rebels near its border and says it supports peace. Resolution, however, hinges on Myanmar's willingness to cede power to minorities and facilitate greater federalism.

On economic development, China faces wary Burmese citizens. Chinese projects have uprooted villagers and hurt the environment, factors that led Myanmar in 2011 to suspend a $3.6 billion dam primarily funded by Chinese energy interests. The suspension remains a sore point.

Mitchell, the former Obama envoy, warned of a larger strategic setback for the U.S.

Failing to consolidate Myanmar's transition would tell the region's autocratic governments they were right, he said, that "democracy doesn't work in Asia."