Updated

China has invested heavily in resource-rich Latin America in recent years, striking major trade deals with governments from Venezuela to Argentina. Now its president is reaching out to one of the few countries in the region where ties have been slow to develop: Mexico.

President Xi Jinping's three-day visit starting Tuesday comes as Mexico debates opening its highly regulated energy sector to more foreign investment.

China's president has said he plans to address Mexico's large trade deficit with the Asian power and discuss ways to increase Mexican exports. Analysts say that could mean oil, which Mexico has and China needs to fuel its expanding economy and the cars of its growing middle class.

"Access to strategic raw materials is key to understanding the dynamic of relations with China," said Hugo Beteta, director for Mexico and Central America of the United Nations Economic Commission for Latin America and the Caribbean. "Clearly there is an interest by China in Mexican oil."

The trip is part of a four-country regional tour that ends in the United States. Xi started in Trinidad and Tobago, where he also met with leaders of other Caribbean countries, and he arrives Sunday night in Costa Rica.

China and Trinidad have had diplomatic ties for almost 40 years, and Trinidad is a major trading partner in the Caribbean for China. Costa Rica is the only country in Central America to have diplomatic relations with China.

U.S. trade still dwarfs China's for the three countries Xi is visiting. But China's trade with Costa Rica and with Mexico has tripled since 2006, according to the International Monetary Fund.

Relations with Mexico had been chilly in the past, especially when former President Felipe Calderon hosted the Dalai Lama in 2011, something China's Foreign Ministry said "hurt the feelings of the Chinese people and harmed Chinese-Mexican relations."

President Enrique Pena Nieto, who took office in December, has been aggressive so far about changing that, and the two new presidents reportedly hit if off on a personal level when Pena Nieto visited China and met with Xi in April. That resulted in an unusually quick diplomatic follow-up, just two months into Xi's presidency.

During the April talks, Xi said "he is committed to working with Mexican authorities to help Mexico export more," Mexico's vice minister of foreign relations, Carlos de Icaza, told The Associated Press.

That's key for Mexico, because its trade deficit with China is exploding, far surpassing that of any other Latin American nation.

While China is looking to assure supplies of raw materials, Mexico is looking to diversify its trade and investment, which have long been dominated by its superpower neighbor to the north.

"In the new global geopolitical and economic map, China is, and I think it has arrived to stay, the world's second economic power," De Icaza said. Mexico "has to understand and strengthen relations with a nation that has such great strategic value."

De Icaza said the countries hope to sign at least a dozen agreements in the fields of trade, energy, tourism, science and technology during Xi's visit.

Mexican exports to China came to a bit over $5.7 billion in 2012, while its imports from that country stood at almost $57 billion, according to statistics from Mexico's Economy Department. Cell phones, video games and parts for electronics factories have been pouring into Mexico, which sends China minerals such as copper and lead.

Overall trade between China and Latin America has expanded quickly over the past decade and the continent now imports more from China than it does from the European Union, according to the U.N. economic agency for the region.

Many countries balance those imports by sending China raw materials: oil from Venezuela, copper from Chile, soybeans from Argentina. But Mexico's exports go overwhelmingly to the huge U.S. market right on its border.

Beteta noted that China imports three-quarters of the oil it consumes.

"China needs to guarantee oil for its citizens' cars, but also obviously for its economy as a whole, which has a high energy intensity, and Mexico is an oil power," he said.

At the same time, Pena Nieto's government has said that it will soon present an energy reform bill to allow greater national and international investment in its oil sector. It hasn't revealed the details of the initiative, but Beteta said it "has awakened the appetite of many people."

State oil company Petroleos Mexicanos, or Pemex, already has taken small steps to increase its relationship with China, which until recently had been minimal.

Of the roughly 2.5 million barrels of crude that Pemex produces a day, about 1.2 million are exported. Energy ministry figures show that 75 percent of these exports go to the United States and about 7 percent to the "Far East." It does not specify how much each specific country in that region receives.

In April, during Pena Nieto's visit to China, Pemex signed its first long-term contract with a Chinese company, agreeing to ship 30,000 barrels a day to the state oil company Sinopec.

Mexico may have other goods and investment opportunities to offer as well.

"China is the principal consumer of coal, gas, oil, of secondary industries like cement, steel, concrete," said Juan Carlos Rivera, director of the Center for Business with Asia at the private Monterrey Technological Institute. "Evidently (China) is looking to satisfy their market needs."

Costa Rican President Laura Chinchilla said her country is looking for agreements in the areas of clean energy, public transportation and student exchanges after Xi arrives Sunday. The government also wants to give a final push to negotiations for the joint construction of a $1.3 billion refinery on Costa Rica's Caribbean coast.

___

Associated Press writer Javier Cordova in San Jose, Costa Rica contributed to this report.