A 27-year-old man who was allegedly harassing migrants with a gun near the US-Mexico border on New Year’s Eve has been detained, police in El Paso, Texas said Wednesday.

Police were notified twice that the armed man was bothering migrants who were staying outside of Sacred Heart Church, located less than 2 miles from the border in the Segundo Barrio.

Authorities were unable to locate the perpetrator on the night of Dec. 31, but received a second call in the early hours of Jan. 1 that the suspect’s pickup truck had been spotted.

Officers pulled the man over and asked him to step out of his truck, prompting him to flee.

Police located the pickup truck and driver involved in the incident the next day.

Brayan, a 19-year-old migrant from Venezuela who was outside Sacred Heart on Dec. 31, told CNN he initially thought the vehicle had pulled up to the church to drop off food, clothing and other supplies.

But when the truck approached, the driver started yelling aggressively. Brayan said he did not understand much of what the man said in English, aside from the word “f–king.”

Migrants sleep outside an overnight shelter at Sacred Heart Churc
The man allegedly harassed migrants who were staying outside of Sacred Heart Church.
James Keivom

“He called over to me, and I thought he was going to help us. When I got closer, he put a gun in my face,” Brayan told CNN. “I kept telling him I don’t understand what you’re saying.”

Brayan told the outlet he crossed the US border illegally on Dec. 28 and did not turn himself in to US Customs and Border Protection (CBP) as an asylum seeker.

Sandragrace Martinez, a mental health clinician and volunteer in the area, then stepped in to de-escalate the situation before calling 911.

“He looked at my crucifix, and he looked at me and he said, ‘I don’t have a problem with you.’ He said, ‘I’m eyes for America, and I’m here to see,’” Martinez recalled.

The whole encounter lasted between 30 and 40 seconds, though Martinez told CNN she saw the same man harassing others near a Greyhound bus station the very next day, prompting her to call 911 a second time.

For weeks, migrants released from CBP custody have camped outside of both Sacred Heart Church and the Greyhound bus station, hoping to catch a ride out of town.

migrants behind bus
The unidentified man pulled out a gun on the migrants on New Year’s Eve.
James Keivom

On Thursday, border patrol agents rounded up a group of migrants who were camped outside of the church, taking any who were not authorized asylum-seekers into custody.

On New Year’s Day, a surprise CBP ambush busted a group of illegal immigrants shortly after they had sneaked over the US-Mexico border into El Paso around 11 p.m.

A trio of Venezuelan migrants who crossed into the US illegally in December also admitted to The Post they snuck into the country and had been sleeping on the streets near Sacred Heart Church for days.

Investigators have been meeting with various witnesses, including migrants, in the neighborhood at the time of the incident as part of an ongoing investigation.

Further details, including the suspect’s identity, will be released once he is formally charged, police said.