From the pint-sized toilets to the colorful bedrooms and backyard filled with overturned tricycles, there’s no question children live here.

What’s less obvious is that the 38 babies and toddlers bunking with their mothers at the Vilma Curling Rivera Institutional Service Center are in prison.

Their mothers are serving time for crimes from fraud, to drug dealing, to robbery – but also devoting time to nap schedules and potty training. As one mother makes funny faces to a scrum of giggling toddlers in the common area, another, Magela (who asked to withhold her full name for her family’s privacy), is putting her young daughter down for a nap. The walls of the bedroom are almost entirely covered by tapestries depicting children’s movie characters, like Elsa from “Frozen.”

“It’s hard to be here with my daughter, but amid all the bad, she gives me hope,” says Magela. She’s been here for six weeks with her 1-year-old daughter while awaiting sentencing on human trafficking charges.

Across Latin America and much of the world, it’s increasingly common to find mothers and their children together behind bars. Although rare in the United States, the practice stems from the perspective that young children are better off bonding with their mothers (and in some prisons, like in Bolivia, with their fathers), even if they have committed a crime. But it raises tough questions about safety, justice, and sacrifice. Should children have to "serve" a parent’s sentence, for example? Is a motherless childhood better than one in prison? And does spending time in prison at a young age encourage cycles of crime or poverty, or break them?

Felipe Dana/AP Tatiana Ribeiro holds her newborn as she shows the names of her other two sons tattooed on her arms, inside the nursery at the Bangu Penitentiary Complex in Rio de Janeiro, Brazil on May 13, 2015. The prison allows inmates' babies to live at the nursery for six months.

Increasingly, the practice is viewed through a human rights lens – with the focus on the rights of the children.

“In prison, the presence of a child is the child’s right – to be with his mother, to breastfeed, to meet essential development needs,” says Kenly Garza, assistant director of the Vilma Curling Rivera prison.

In Costa Rica, children are allowed to live with their mothers for the first three years of their lives. In Mexico, children can stay with their mothers until they are 6 years old. In Afghanistan, a child can famously languish in prison with her mother until she’s 18. Roughly half the countries in the world allow mothers serving a sentence to live with their children, if only for a few months, according to a 2014 Library of Congress report.

“There are some who think this is a good thing, and some who see it as bad,” says Ms. Garza. “But in most cases, opinions are based on stereotypes. If you’re in prison, you’re automatically [labeled] a bad mother.”

'I'd go crazy without her'

A young boy scrambles on the orange-tile floor, grabbing for his paper airplane, on a recent morning at Vilma Curling Rivera. Above him an eager playmate lets out a shriek trying to wiggle his way out of his high chair. Mothers and children sit along the periphery of the common area, sharing food and soft drinks, rocking babies in strollers, and some eyeing news of snow in Europe on the flat-screen TV.

Under Costa Rican law, children don’t spend their entire day in prison; they’re sent to off-site day care for several hours. Nongovernmental organizations teach mothers parenting skills and work on personal goal-setting and development.

Lady, who also asked not to use her surname, was pregnant when she was sent to prison five months ago on fraud charges. That meant living with the general prison population, who sleep in tightly squeezed rows of bunk beds. She had 50 roommates at the time. Once her now four-month-old daughter was born, she was moved into a private room with a crib, and neighbors who instantly had something in common: motherhood.

“It’s definitely nicer here,” she says of the children’s area, its own building in the low-slung prison complex. “I think I’d go crazy without her,” she says of her daughter. “I think I benefit most from having her here.”

Mariana Bazo/Reuters Guards play with a child at a nursery school inside Santa Monica women's prison in Lima, Peru, on Oct. 31, 2016.

Critics say perks like a private room or the constant companionship of a child will incentivize more inmates to get pregnant. Garza says evidence doesn’t back that up – the population of mothers with children has remained steady over the past several years. Others argue prison becomes less of a punishment when family is permitted to join those serving time, that committing a crime punishable by prison makes a mother unfit, or that it’s an inherently harmful place to grow up.

“The children might be exposed to bad language, sometimes there’s aggressive behavior [among inmates],” says Isabel Gámez Páez, who runs programming for women in prison in Costa Rica’s Ministry of Justice. She argues prisons need to be redesigned overall to better accommodate the unique needs of women, including motherhood.

But the reality is that children are often better cared for in prison – where meals are guaranteed and an adult is always present – than on the outside, Garza says.

The majority of women in prison in Costa Rica are there for drug-related crimes, like small-scale trafficking, an offense that research suggests is frequently motivated by a lack of employment opportunities, poverty, or coercion by family or romantic partners. A 2010 study found that 95 percent of women in jail for bringing drugs into prisons in Costa Rica were single mothers. Often, when women go to prison their dependents are put at risk of falling deeper into poverty, or taking part in criminal acts as well, experts say.

Improving the system

For cases where children do end up behind bars with their mothers, there are best practices around the world that could be applied elsewhere, experts argue. In Norway, for example, children aren’t allowed to live in jail, but they can visit three times a week and call at any time. They also have modular homes, outside of the prison, where incarcerated mothers can visit with their kids.

Alternative sentencing for non-violent crimes and low-level drug violations could also balance the tension between serving justice and the needs of a minor, writes Fabiola Mondragón, a researcher at the Mexican think tank CIDAC, in a 2017 opinion for news site Animal Politico.

That’s a relatively new process in Costa Rica, where women who have trafficked drugs into prisons and who come from vulnerable backgrounds – like caring for dependents alone – have the chance to go to rehab and serve community service instead of going to jail.

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

“A mother is a figure you can’t substitute in the life of a child,” says Magela, her young daughter crawling cautiously under an empty high chair. “They are tiny. Being here as an infant isn’t so traumatic. The separation would be far worse.” She has experience with that as well: her 5-year-old daughter isn’t living with her here, though she can visit frequently.

“Right now I’m vague [when telling my older daughter] about where I am. But when a child is old enough, you have to tell her the truth: Your mother made a mistake.”