NOGALES, Ariz. — Their short pilgrimage across desert sands stopped where it had to stop, at the 20-foot high security fence that separates Nogales from Mexico. And there Cardinal Sean P. O’Malley and eight other American Catholic bishops did what priests and bishops always do — they said Mass.

But this was different. Their uncommon congregation had gathered on both sides of the fence, about 500 on the United States, 100 or so south of the border. They came together at the emotional crest of the service, with communion wafers passed through the fence to the eager hands reaching north — the direction of hope and, for far too many immigrant border crossers, O’Malley said, danger and death.

“The desert is lined with the unmarked graves of thousands,’’ O’Malley said during the service Tuesday morning. Summoning the memory of the estimated 6,000 people who have perished trying to make the crossing during the last 15 years, he called it long past time for comprehensive immigration reform.

“We are here today to say they are not forgotten,” O’Malley told the gathering.

The bishops meant their outing to evoke the example Pope Francis, who traveled last July to the Italian island of Lampedusa, a point of arrival for migrants from Africa and the Middle East seeking to reach Europe. The pontiff blasted a “globalization of indifference” to immigrants that day and placed a wreath in the sea for 20,000 people who have died attempting to make their way across the Mediterranean.

Photos: Mass at US-Mexico border

In that spirit, O’Malley took a walk through the Arizona desert, tracing the migrant trial followed by people trying to enter the United States. He then led eight prelates who make up the US bishops’ Committee on Migration in laying a wreath at the border in remembrance of those many lives lost.

O’Malley, who speaks fluent Spanish and has a long history of outreach to Latino immigrants, told the Globe the bishops want a reform featuring a path to citizenship. In the meantime, he said, they’re calling for a halt to what they describe as an “inhumane deportation and detention system” that often splits families.

The Boston prelate said he regards the defense of immigrants as a priority for the Catholic church tantamount to its fight against abortion.

“This is another pro-life issue,” O’Malley told the Globe. He said doesn’t believe any Catholic who takes church teachings seriously can “support the status quo” on immigration policy.

The three-day trip to the border provided O’Malley and the other bishops an education in the realities of life as an undocumented migrant.

On Monday, the bishops visited a soup kitchen and center for recently deported migrants called the “Kino Border Initiative,” located in Mexico just across the border from Nogales. Named for a 17th-century Jesuit saint who was a missionary in the area, it’s jointly run by members of the Jesuit order in the United States and Mexico, as well as a Mexican community of nuns called the Missionary Sisters of the Eucharist.

During an afternoon meal, bishops served plates of rice, beans, and salad to roughly 60 migrants, including a mix of Mexicans and Central Americans, and then sat at tables to hear their stories.

A volunteer who asked not to be identified for fear of retribution explained that criminal gangs who prey on immigrants operate more or less openly in the area.

“In the hills right over there, they’ve got 12- and 14-year-old kids with walkie-talkies,” he said, pointing across the street from the soup kitchen. “They’ll spot a group of six migrants walking to the border and call it in, and then goons will show up demanding these people give up their money, their cellphones, whatever they have.”

The volunteer said that despite the risks, his time working with deported migrants “is the best church I’ve ever been in.”

“For me, this is what it means to do Eucharist,” he said, referring to the Catholic Mass. “These people live lives of horrible mistreatment and abuse, but for one hour every day here, they’re all together and they’re safe.”

The bishops also met a small group of female deportees, who agreed to tell their stories on the condition they not be identified. They were residing in a women’s shelter run by the Kino Border Initiative.

One Mexican woman said she had lived in Phoenix for 40 years, originally crossing the border with her young daughter after a coyote — a paid border guide — abandoned them because they couldn’t walk fast enough. She eventually returned to Mexico to visit family members, she said, and was arrested and deported attempting to renter the United States to be reunited with her daughter.

The six weeks she spent in a detention center, she said, were “the worst time of my life.”

A Honduran woman told a harrowing tale of fleeing her country because a man she had been seeing threatened to kill both her and her 10-year-old daughter. After making sure her daughter was safe in a boarding school, she said, she headed for the United States because her mother lives there.

She said she had been kidnapped and held for ransom along with a cousin who was pregnant, and, while they managed to escape, the cousin only got as far as Mexico City before pregnancy and deteriorating health prevented her from going further. The Honduran said she later avoided being raped by falsely claiming to have stomach pains related to pregnancy but said that a man in their party was taken away, never to be seen again.

Despite it all, she said she still plans to make it to America.

“With God’s help, I want to get across the border to help my mom,” she said.

The bishops also met with an advocacy group called the Border Justice Collective, dedicated to reining in what they see as excessive use of force by US Border Patrol agents. The group included relatives of a 16-year-old Mexican teen named Jose Antonio Elena Rodriguez, who was shot to death in October 2012.

“We need someone with more power than we have to go to the [US authorities] and say this has to stop,” said Gabriela Lopez, an aunt of the slain teen. “We want justice.”

During a press conference held after the Tuesday Mass, a 13-year-old girl named Fatima Rojas interrupted the bishops’ presentation and asked to be heard. Wiping away tears, she said her 20-year-old sister Rosy has been detained at a center in Eloy, Ariz., for six months, and she pled for help from the bishops in getting her released.

Such experiences, according to O’Malley, are why the Catholic church regards immigration reform as a moral priority.

“We have to rescue this issue from politics,” O’Malley said. “This isn’t about statistics or policy, it’s about people.”