An expected U.S. economic retreat from Latin America under Donald Trump is causing the region's leaders to look halfway around the world, to China, for help weathering the possible financial headwinds.

They'll have the perfect opportunity to make their appeal this week when Chinese President Xi Jinping attends a Pacific Rim summit as part of a visit to Ecuador, Peru and Chile.

This is Xi's third time in Latin America since taking office in 2013, and when he wraps up the tour he will have visited 10 countries in the region — the same number as President Barack Obama, who has been in office twice as long.

Trump on the campaign trail pledged to break up trade deals such as the North American Free Trade Agreement, deport illegal migrants and build a wall to keep out millions from Mexico and Latin America, sending shockwaves across a region that for two centuries has looked northward for policy guidance.

Over the past decade China has displaced the U.S. as the main trading partner in country after country in Latin America as demand for the region's soybeans, oil and iron ore have fueled the fastest growth in decades. But more recently, as China's demand for raw materials has been slowing, the region's economies have taken a hit, dampening the once-torrid love affair with the world's second-biggest economy.

Margaret Myers, a China expert at the Washington-based Inter-American Dialogue, said that most South American countries have awoken to the pitfalls of dependence on commodity exports and would prefer closer ties to the U.S., which buys the sort of manufacturing goods that generate more jobs.

"But the question is whether the U.S. will reciprocate," she says. "Nobody in the region is expecting much from Trump in terms of really productive policy. That leaves room for China to play a much more important role."

Some of China's priorities and growing prowess in the region will be on display during Xi's trip.

In Ecuador, a dollarized-economy that is battling a deep recession, Xi will inaugurate on Friday the country's biggest hydroelectric dam, which was built by a Chinese firm and paid for with some of the nearly $8 billion lent to the country since 2007.

From there he heads to Peru, to attend a summit of Asia Pacific Economic Cooperation group and a meeting with President Pedro Pablo Kuczynski, a former Wall Street investor who nonetheless chose China for his first foreign trip after taking office in July. The weeklong tour wraps up in Chile, which recently opened a branch of a state-run Chinese bank that will be South America's first clearinghouse for transactions in the tightly-controlled yuan.

Elsewhere, in Venezuela, the head of state-run China National Petroleum Corporation on Thursday signed a $2.2 billion accord to jointly boost oil production needed to lift the OPEC nation out of a crisis marked by severe food shortages and triple-digit inflation.

"All of our thanks for all of the support given Venezuela in the difficult years, 2014, 2015 and especially 2016," a visibly pleased President Nicolas Maduro said at the signing ceremony. "Our older sister China has not left Venezuela alone in these difficult times."

While Trump's victory has all but killed the 12-nation Trans-Pacific Partnership, which would've included Mexico, Peru and Chile, China continues to court the region with offers to strengthen existing free trade agreements with Costa Rica, Chile and Peru as well as negotiate new ones with Uruguay and Colombia. In the past decade, China's two biggest development banks have pumped in $125 billion to Latin America — more than the Washington-based World Bank and Inter-American Development Bank combined.

Xi, in a column for El Comercio newspaper, referred to the emerging ties with Peru as a "win-win" relationship encompassing areas as diverse as investment in infrastructure and energy to the shared heritage represented by the beloved "chifa" cuisine created by Chinese immigrants a century ago.

To be sure, a U.S.-China trade war would have ripple effects across Chinese industry that would also depress demand for Latin America's raw materials.

But for now Chinese businessmen attending the APEC summit see nothing but potential.

Tang Ning, founder and CEO of wealth manager and micro-lender CreditEase, said Brazil and other parts of Latin America are ripe for venture capital in the same way China was 20 years ago. Nonetheless, he cautions that Trump's disruptive election is not a driver of its interest in Washington's backyard.

"We take a very long-term view," said Tang in an interview. Politics "isn't a major part of our conversation."

___

Joshua Goodman is on Twitter at https://twitter.com/apjoshgoodman His work can be found at http://bigstory.ap.org/journalist/joshua-goodman