Ciudad Juarez (Mexico) (AFP) - Throngs gathered at Mexico's border with the United States on Wednesday for a huge mass with Pope Francis highlighting the plight of migrants -- a hot-button issue on the US presidential campaign trail.

The 79-year-old pontiff chose Ciudad Juarez as the last stop of a five-day trip to Mexico to address immigration and to visit a notorious prison, where he urged inmates to help break the country's cycle of violence.

A huge stage was set near the border fence for the open-air mass with more than 200,000 Catholic faithful waiting for the pope's arrival.

A sea of pilgrims flocked there early in the morning, waving flags and wearing shirts with the words "I love the pope."

Francis was expected to salute people watching on the other side of the Rio Grande in El Paso, Texas.

Catholics streamed into a 51,000-capacity stadium in the US city, where the crowd performed a wave while waiting for the mass to be broadcast on a giant screen.

The pope's decision to make a plea for migrants at a mass on the US border coincides with the US presidential election primaries where the fate of 11 million undocumented immigrants is the source of vivid debate. One candidate wasn't pleased.

Republican White House hopeful Donald Trump, who wants Mexico to pay to build a wall along the border, called the pope a "very political person."

"I think that he doesn't understand the problems our country has. I don't think he understands the danger of the open border that we have with Mexico," the billionaire real estate tycoon told Fox Business channel last week.

Responding to Trump's comments, Vatican spokesman Federico Lombardi said that the pope was a man of faith and "one should not be surprised that his pastoral and spiritual message has political repercussions."

- 'More compassion' -

Maria Ortega Cruz Bautista, 62, traveled from Chicago to be with her family at the mass in Ciudad Juarez, a city she left 14 years ago.

She voiced hope that the pope's message will prompt authorities "to have more compassion and more consideration for migrants."

Story continues

In El Paso, Sandra Ovalle, 32, shared a similar feeling as she headed with her family to the Sun Bowl stadium.

"We hope that the pope will make our leaders change, so that we get support and that things change for the better," said Ovalle, a native of Mexico's northern Chihuahua state who now lives in the US state of New Mexico.

Central Americans have been leaving their poor and gang-infested countries in droves, crossing Mexico's porous southern border with Guatemala on their way to the United States.

The trek across Mexico is filled with dangers -- from gangs that steal, kill or seek to forcibly recruit them, to corrupt officials who demand bribes to let them travel.

- Inmates as 'prophets' -

While pilgrims waited for the mass to start, Francis visited a prison, nearly a week after a riot killed 49 inmates at another Mexican penitentiary.

He visited its chapel and addressed hundreds of inmates in the prison yard, telling them they should use their experiences to help "put an end to this cycle of violence and exclusion."

"The one who has suffered the greatest pain, and we could say 'has experienced hell,' can become a prophet in society. Work so that this society which uses people and discards them will not go on claiming victims," he said.

The pope argued that a country's security problem "is not resolved only by incarcerating," arguing that the structural and cultural causes of crime must be addressed.

The Juarez prison was the scene of deadly riots a few years ago, with dozens of prisoners killed in recent years, but it has been held up as an example of efforts to improve Mexico's notoriously overcrowded prisons.

Ciudad Juarez stands as a grim symbol of Mexico's violence, but also of hope.

It became the country's most dangerous city a few years ago as the Sinaloa and Juarez drug cartels fought for control of drug routes.

Their turf war left as many as 3,000 dead in 2010, but the murderous rampage gradually eased afterward, with the toll falling to 300 last year.

The mass will also be attended by families of victims of Mexico's drug violence, which has left more than 100,000 people dead or missing in 10 years.

The parents of 43 missing students whose case has caused international outrage were offered three seats at the mass, but lacked the means to go.