HONG KONG -- Two airline passengers who locked a stranger's crying grandchild in a plane restroom have caused outrage in China and sparked a heated online debate on how to handle upset children in public spaces.

The incident went viral this week after one of the two women involved posted a video on Chinese social media, which showed them inside a locked lavatory with the wailing girl, who appeared to be about a year old.

"We won't let you out unless you stop crying," a woman sitting on the toilet told the toddler as she struggled out of the adult's lap and reached for the door, according to the video posted on Douyin, China's version of TikTok.

As the girl stopped crying, the woman filming the video picked her up and told her: "If you make any noise again, we'll come back (to the bathroom)."

The incident took place August 24 aboard a Juneyao Airlines flight from the southwestern city of Guiyang to Shanghai.

The toddler was flying with her grandparents and cried non-stop during the nearly three-hour flight, the airline said in a statement Monday. The two passengers took the child to the restroom to "educate her" with her grandmother's consent, the statement added.

But a day later, as criticism mounted, the airline's customer service department apologized for the incident and "oversight of the crew," adding it condemned the two passengers' behaviour, according to the state-run Southern Metropolis Daily.

One of the women, who posted the video online, said her intention was to ensure a "restful flight" for other passengers. But her post quickly met a backlash, with many social media users accusing her of being heartless and bullying the child. The video was later deleted.

"Adults in their 30s can have emotional breakdowns, but people don't allow toddlers to have theirs," said one comment on China's X-like Weibo platform, garnering thousands of likes.

"We were all once children … Don't be a cold-blooded adult," read another popular comment.

Many others expressed concern that the incident may negatively impact the child's mental health.

Multiple Chinese state media outlets have also weighed in, accusing the two women of "inappropriate" behaviour and calling for "greater understanding" from the public toward young children who cannot control their emotions.

In recent years, complaints about young children crying or acting out on flights and trains have regularly trended on Chinese social media, with many accusing parents of not doing enough to manage their kids' behaviour.

These incidents have fuelled an ongoing debate about parenting in public places in China, where the government is desperately trying to persuade couples to have more children.