SAN FRANCISCO, Nov 17 (Reuters) - U.S. President Joe Biden concludes a four-day diplomatic push with China as well as other Pacific nations on Friday in a final meeting with world leaders and a visit with Mexican President Andrés Manuel López Obrador.

Biden, who met with President Xi Jinping on Wednesday and used Thursday to highlight strong economic ties between the U.S. and the other Pacific nations, will have one final large gathering of leaders on Friday where he will formally transfer the chair of the Asia-Pacific Economic Cooperation to Peru President Dina Boluarte.

He will also participate in a bilateral meeting with Obrador, where the two leaders are expected to discuss migration and ways to crack down on fentanyl trafficking.

The bilateral meeting comes as the two countries are at odds over several significant trade issues, including Mexico's efforts to phase out use of genetically modified corn - a move that hurts U.S. farmers - and efforts to block U.S. energy investments into Mexico.

The worsening of trade relations between Washington and Mexico City comes even as their economic integration grows.

Mexico overtook Canada and China to become the largest U.S. goods trading partner in the first half of 2023, reaching total trade of $396.6 billion as Mexico's automotive production grows and other U.S. companies shift supply chains from China closer to home.

In 2022, Mexico had a $130.5 billion goods trade surplus with the United States. It is on track to more than double from the $69 billion surplus in 2017, when former President Donald Trump launched a renegotiation of NAFTA after threatening to quit the pact, claiming it was draining U.S. manufacturing jobs. (Reporting By Jeff Mason and Jarrett Renshaw; Editing by Scott Malone and Stephen Coates)