President Barack Obama has concluded a trip to Central America by promising to help Mexico fight its deadly drugs gangs, and to enhance the trade between the two countries.
More than a billion dollars of trade is conducted across the border each day, making the two nations by far each other's most important bilateral trading partner. And yet the border also has a dark side: Mexican drug lords have the world's biggest market right on their doorstep, and illegal access to the firearms that Americans pride themselves in owning.
It was something the president touched on when he addressed a group of students in Mexico City's famed anthropology museum on Friday.
"The United States recognises that we've got responsibilities, that much of the violence in the region is fuelled by demand for illegal drugs, including in the United States," he said.
"We also recognise that most of the guns used to commit violence here in Mexico come from the United States."
More than 70,000 people have died in Mexico's drugs wars since 2006, when then-president Felipe Calderon "declared war" on the cartels. The surge in gun violence in Mexico also coincided with the 2004 expiration of a ban on assault rifles in the US.
But Mr Obama said that Mexico, now under the leadership of President Enrique Pena Nieto, was ready to take "its rightful place in the world."
"The relationship between our two countries should not be defined by the threats we face, but by the prosperity and opportunities we can generate together," he told the 800 students.
"You are the dream – the Mexico that you imagine has to be built, has to be won. No one else can do it for you – you are the future."
An inescapable theme during the trip was the US effort to overhaul the nation's immigration laws – an issue of intense interest among Latinos in the United States and in Mexico and Central America. The vast majority of the 11 million immigrants illegally in the United States are from Latin America, with six million of them from Mexico alone. Mr Obama supports legislation that would give those immigrants a path to US citizenship.
As Congress debates immigration legislation, Mr Obama's bullish – even overly rosy – depiction of Mexico's economic prospects were meant to convince the US public and politicians that Mexico no longer poses the illegal immigration threat it once did.
"The long-term solution to the challenge of illegal immigration is a growing and prosperous Mexico that creates more jobs and opportunities for young people here," he said.
Mexico, Mr Obama said, has lifted millions of people from poverty.
But while its economy has grown, the wealth has yet to trickle down to average workers. Huge poverty rates held steady between late 2006 and 2010, the most recent year for which government statistics are available. Between 40 and 50 per cent of the population of 112 million Mexicans live in poverty, earning less than $100 a month.
After 24 hours in Mexico – Mr Obama's fourth visit to the country – he moved on to Costa Rica, again pressing other Central American leaders to deal with poverty and security while reaching out to a politically powerful Latino audience back home.
The trip served as a nod to the vast Hispanic population in the United States, which heavily supported him in the 2012 election and which retains strong family and cultural ties to Latin America.
"In fact," he said on Friday, "without the strong support of Latinos, including so many Mexican Americans, I would not be standing today as president of the United States. That's the truth."