The man was taken into custody around 9 p.m. local time Wednesday. He was being processed at the Lordsburg Border Patrol Station when he “fell into medical distress.”
“Attempts to revive the individual were unsuccessful. Our condolences are with his family,” CBP said.
CBP’s Office of Professional Responsibility is reviewing the situation in accordance with agency policy, the statement said.
The Department of Homeland Security Office of the Inspector General, the El Salvador government, and members of Congress have been notified, CBP said.
The death comes at a time of increased scrutiny for immigration authorities amid reports of inadequate conditions at border detention facilities.
On Tuesday, agents apprehended a group of 225 people near Antelope Wells, about 95 miles south of Lordsburg.
The Border Patrol has seen a spike in border crossers in that remote area, especially families with children. Guatemalan 7-year-old Jakelin Caal Maquin crossed through there in December before later dying of sepsis shock.
The Associated Press contributed to this report.