BALI, Indonesia — A sobbing Heather Mack gave up custody of her young daughter Friday to an Australian woman until Mack gets released from prison.

Mack, who’s serving a 10-year sentence for assisting in the murder of her Chicago-area socialite mother, Sheila von Wiese-Mack, at a luxury resort in Bali in 2014, handed over 2-year-old Stella Schaefer to Oshar Putu Melody Suartama at Bali’s Kerobokan prison.

Prison chief Tony Nainggolan said the girl’s development will be supervised by government social workers.

“We will allow the girl to meet her mother anytime,” Nainggolan said.

Tommy Schaefer, who was Mack’s boyfriend, is serving an 18-year term for bludgeoning von Wiese-Mack to death, then stuffing her body into a suitcase.

The baby girl was born shortly before her parents were convicted.

Under Indonesian law, the baby was allowed to live with her mother in prison until she turned 2 years old.

Mack, 21, broke down in tears as she gave Stella to Suartama, an Australian woman married to a Balinese man, said Mack’s Indonesian lawyer, Yulius Benyamin Seran.

He said Suartama, who has two sons and lives in Bali, befriended Mack when the couple was first detained for murder. She helped Mack as an interpreter and supported her during the trial.

“She is the right person to raise Stella, she loves her,” Seran said.

The handover was a victory of sorts for Mack, who wants Stella to say in Indonesia so she can see her as she completes her sentence.

Schaefer had been fighting a legal battle to have his grandmother, who lives in Forest Park, raise the child. Earlier this week, Cook County Circuit Judge Susan Kennedy Sullivan ruled that, without the consent of both parents, she couldn’t grant guardianship to the grandmother, Kia Walker.

On Friday, Walker’s attorney, Michael Goldberg, said in a statement: “We are extremely disappointed to learn that the Indonesian government allowed a non relative to take Stella. She is an American citizen with an American passport. She belongs in the United States with her grandmother, and Kia will continue to fight for her granddaughter.”

Contributing: Stefano Esposito