Hospital staff diagnosed Felipe with a common cold and fever, and released him midafternoon with prescriptions for antibiotics and ibuprofen.
Felipe was transferred back to the hospital later that evening, after he began vomiting, and he died hours later. In its initial statement, CBP said the boy died after midnight on Tuesday, but the agency later adjusted the time to late Monday.
CBP said it does not know the cause of Felipe's death.
"This is a tragic loss," CBP Commissioner Kevin K. McAleenan said in a statement. "On behalf of U.S. Customs and Border Protection, our deepest sympathies go out to the family."
Felipe and his father were apprehended several miles from the Paso del Norte Port of Entry in El Paso, Texas, on Dec. 18, according to the updated statement from the agency.
Two days later, they were transferred from the processing center at the Paso Del Norte Port to the El Paso Border Patrol Station. Late on Dec. 22, the boy and his father were moved a final time, to the station in Alamogordo. CBP said they were transferred "to finalize processing."
"These checkpoints are the small stations that travelers pass on highways as they move away from the border," said NPR's Monica Ortiz Uribe. "They're not the kind of facilities equipped for long-term stays."
A 7-year-old Guatemalan girl died of dehydration and septic shock while in government custody earlier this month. The girl, Jakelin Caal Maquin, had been apprehended in New Mexico after crossing the southern border into the U.S. illegally with her father.
Her death on Dec. 8 prompted calls for investigation from the Congressional Hispanic Caucus, which says "disturbing systematic failures" and a lack of medically trained agents prevented the government from adequately caring for its child.
Last week, a delegation from the caucus, including chair Rep. Joaquin Castro of Texas, visited the facility where the girl had been held.
The Democratic congressman told reporters that officials failed to intervene in several instances when they could have saved Jakelin's life.
Jakelin and her father were taken to the Antelope Wells Port of Entry after turning themselves in to CBP officers in early December. The girl began vomiting during a bus transfer to Lordsburg Border Patrol Station.
By the time she arrived at the station, she had stopped breathing and had to be resuscitated. She was flown by helicopter to a hospital in El Paso, Texas, where she died.
The congressional delegation criticized the medical facilities at the Lordsburg station and questioned CBP's decision to transfer the girl to a second facility. Members also criticized the administration for demanding funding for a border wall, rather than ensuring that detention centers had sufficient resources.
Following the boy's death on Monday, the Border Patrol will conduct secondary medical checks on the children in CBP custody, the agency said; its Office of Professional Responsibility will also conduct an investigation.