The key in Sweden was that the policy allowed fathers to take intermittent, unplanned days of paid leave. The researchers — who used Sweden’s vast administrative data, including birth records, leave claims and medical records — were able to see that fathers often used their leave on days that mothers sought health care. The fathers’ presence could have averted the need for more serious medical care, such as by enabling mothers to sleep, seek preventive care or get antibiotics early in an infection, they said.

The working paper included data on parents who had their first baby between 2008 and 2012, and focused on comparing those born in the last three months of 2011 and the first three months of 2012, when fathers could take the flexible leave. The effects were strongest in women with histories of medical problems. The researchers looked at two other areas and did not see a change: antidepressant and painkiller prescriptions.

Previously, Sweden required that mothers’ and fathers’ leaves not overlap (with the exception of 10 days around the birth). The goal, which other countries like Norway and Canada have also pursued, was to promote father-baby bonding and gender equity. There’s evidence that when fathers are solely responsible for a baby, they remain more involved with their children and with household tasks for years to come.

But there was an unforeseen consequence. Mothers’ health seems to suffer when fathers are prevented from being home in the months after birth (a period sometimes referred to as the fourth trimester because the infant is still so needy and the mother’s body is still going through so many changes).

[The topics new parents are talking about. Evidence-based guidance. Personal stories that matter. Visit NYT Parenting for everything you need to raise thriving babies and kids.]

Sweden’s paid parental leave policy is among the most generous of any country. It gives new parents 16 months of leave to divide between them, which can be used until the child is 12 or to work part time. The American states that offer paid leave — Connecticut just passed a bill that would make it the seventh state to do so — give much less, between four and 12 weeks.

Yet even a few days of paternity leave can make a large difference for mothers’ postpartum health, the Swedish study shows. The typical father in Sweden took only a couple of extra days. It wasn’t the length that seemed to matter most, but his flexibility to take time when the mother needed it.