By Dave Graham

MEXICO CITY (Reuters) - Mexico said on Wednesday it would throw its relationship with the United States wide open in talks with the incoming Trump administration, putting security, migration and trade on the table as it seeks to avoid a major economic shock.

U.S. President-elect Donald Trump has threatened to tear up a trade agreement that underpins Mexico's export model if he cannot renegotiate its terms in his favor, battering the peso currency and fueling uncertainty over foreign investment.

President Enrique Pena Nieto said Mexico would take a broad approach to the challenge, seeking a settlement that would benefit both Mexico and the United States as he looks to carve out a platform that gives him room for maneuver in talks.

"All the issues that define our bilateral relationship are on the table, including security, migration and trade," Pena Nieto said in a speech to diplomats in Mexico City, sketching out his negotiating position for the first time.

Reuters reported last month that Mexico's government aimed to use security and migration to gain leverage over the United States in its talks with Trump, and could offer to reinforce its borders to get a better deal on trade.

Pena Nieto said Mexico would invest in a more secure border, but repeated his posture that it would not pay for the border wall Trump plans to build.

During the campaign, Trump threatened to have Mexico fund the wall by blocking remittances from Mexicans living in the United States. Pena Nieto said he would work to ensure those funds continued to flow freely across the border.

Pena Nieto said the U.S. government shared responsibility for migrants seeking to reach the United States, and should also work to stop the southward flow of weapons and illicit funds that help finance Mexican organized crime.

Mexican officials point to a jump in deportations of illegal immigrants under Pena Nieto, and to the country's importance in working with U.S. law enforcement to combat rising U.S. demand for lethal drugs such as heroin smuggled in from Mexico.

If Trump seeks to hurt Mexico on trade, there is little incentive for the Mexican government to go out of its way on behalf of the United States on other issues, they argue.

TRADE DIVERSIFICATION

Mexico sends 80 percent of its exports to the United States and is eager to uphold the North American Free Trade Agreement (NAFTA) between the two nations and Canada that acts as a conduit for the bulk of foreign direct investment in Mexico.

Trump has called NAFTA a "disaster" and vowed to scrap or recast it in the hope of bringing jobs back to America.

Mexico, meanwhile, must work to reduce its dependency on the United States, economists and policymakers have said.

Pena Nieto said his government would seek to diversify business ties with Asia and Latin American countries where it had room for improvement, such as Brazil and Argentina.

Mexico also aims to wrap up talks with the European Union on updating a joint trade accord in the next 12 months, he added.

In a news conference on Wednesday, Trump said he would soon begin talks with Mexico on the border wall and would make Mexico reimburse the United States for construction costs.

Trump also promised a major border tax on companies that moved jobs outside the United States, giving the example of firms relocating plants to Mexico.

(Additional reporting by Frank Jack Daniel, Ana Isabel Martinez, Michael O'Boyle and Lizbeth Diaz; Editing by Andrew Hay)