A UN human rights expert on Monday called on Washington to conduct a thorough, independent probe into the death of a 7-year-old Guatemalan girl while in Border Patrol custody — and said the US should stop detaining children.

Felipe González Morales, the UN’s special rapporteur on the human rights of migrants, has sent a formal complaint to Secretary of State Mike Pompeo in which he demands a full accounting of the death of Jakelin Caal, according to the UK’s Guardian.

“Redress to her family should be provided and if any officials are found responsible they should be held accountable,” he said in a statement.

“The government should also address failings within the immigration system, and specifically within the US Customs and Border Patrol agency, to prevent similar situations,” he said.

Jakelin died on Dec. 8, less than 48 hours after she was detained with her dad at a remote border crossing in New Mexico.

She was revived twice after going into cardiac arrest and taken to a Texas hospital with a temperature of 105.7 degrees. Initial news reports said she died of dehydration and exhaustion, but US officials later said she had suffered brain swelling and liver failure.

Her father, Nerv Caal, 29, had signed a waiver saying the girl was in good health, but some have questioned whether he knew what he was signing. The form was reportedly in English and read to him in Spanish.

CBP has claimed it properly cared for Jakelin, providing her and her father with food and water, and doing everything it could to save her life. Her father has maintained that they were not offered water.

González Morales, a Chilean professor of international law, told the Guardian that several international human rights bodies had repeatedly warned that kids should not be kept in detention based on their immigration status.

“Detention of children has such a severe impact on them that we have repeatedly warned of the risks,” he said, stressing that the Trump administration was bound by international law.

“When a person, especially a child, is in the custody of a state, that state has to ensure their rights,” he said. “States have an obligation to care for migrants who arrive at the border. They cannot treat them as animals in inhuman conditions. I’m not saying this happened in this case, but the US has a duty in this regard.”

US officials have said the Department of Homeland Security’s internal watchdog will investigate Jakelin’s death — but lawyers for the girl’s family and several members of Congress have slammed the probe as self-policing.

Homeland Security Secretary Kirstjen Nielsen has blamed Jakelin’s death on her family, calling it “a very sad example of the dangers to migrants.”

UN rights experts serve in a voluntary capacity and do not speak for the office of the UN High Commissioner for Human Rights.

“Something as serious as the death of this girl should not be left to administrative authorities,” González Morales told the news outlet.

“I want to make sure that judges and public attorneys carry out the investigation fully in an independent manner without any pressure from the immigration authorities. An internal CBP inquiry would not be satisfactory.”

He also said he wanted the probe to determine whether the family had been placed in “hieleras” — holding cells where migrants have complained of being kept in freezing conditions with only aluminum blankets.

“There have been many complaints about the conditions of migrants in hieleras — they are places that pose a risk to the health of the persons detained,” he said.

Meanwhile, the tiny white coffin bearing Jakelin’s body ended its heartbreaking journey home early Monday in a tiny hamlet 220 miles north of the capital.

Villagers shed tears and watched as the coffin arrived at the home of Jakelin’s grandparents in San Antonio Secortez, where relatives had set up a wooden altar flanked by flowers, photographs of the child and the hand-lettered message, “We miss you.”

Her mom, Claudia Maquin, closed her eyes and moaned in anguish when confronted with her daughter’s body — then covered her face and cried.

With Post wires