The earlier babies are born, the more likely they are to later get a prescription for ADHD medication, according to a new study from Sweden.

Researchers found that babies born as little as three weeks before their due dates had an elevated risk for attention deficit hyperactivity disorder (ADHD).

The findings suggest that mothers considering scheduling cesarean births a few weeks early reconsider and deliver as close to term as possible, the authors say.

People with ADHD have trouble paying attention or controlling impulsive behaviors, and can be treated with behavioral therapy or medication.

The condition is diagnosed in about three to five percent of school-aged children in the United States.

In the new study, the researchers analyzed a Swedish database of more than a million children aged 6 to 19 years; 7,506 of them had received a prescription for ADHD medication.

The children born extremely prematurely -- between 23 and 28 weeks of pregnancy -- were most at risk of later developing ADHD, with their chances being two and a half times greater than a baby born at full term (after 39 weeks).

Fifteen out of every 1,000 babies born at this extremely premature age later received a prescription for ADHD medication, compared to six out of every 1,000 babies born between 39 and 41 weeks of pregnancy.

Low birth-weight and severe prematurity were already known to be risk factors for developing ADHD.

This study confirms those findings and reveals that even babies born very close to full term - between 37 and 38 weeks of pregnancy - are still 20 percent more likely to develop ADHD, said Dr. Anders Hjern, the lead author.

Seven out of every 1,000 children born moderately premature (37-38 weeks) were prescribed ADHD drugs.

"The finding that early term birth carries an increased risk for ADHD has important implications for planned cesarean births, which are often performed during these very weeks," Hjern told Reuters Health in an email.

"To minimize the risk for ADHD these births should be planned as close to the full term date (that is week 40) as possible."

Other factors, such as the mother's smoking habits and genetics, also play a role in a child's risk of developing ADHD.

The researchers accounted for these potential influences by comparing siblings, and found that extremely premature babies remained twice as likely to develop ADHD as their full-term brothers or sisters.

The study, published in the journal Pediatrics, did not look at children diagnosed with ADHD, only those who filled a drug prescription for it.

The new research is helpful in confirming the link between prematurity and ADHD, but the underlying physiology that's actually causing the ADHD in children born prematurely is not yet understood, said Dr. Glen Aylward, a professor at Southern Illinois University School of Medicine who was not involved in the current study.

The study's authors speculate that some aspect of gradual brain development could be disrupted when a baby is born early, leading later on to ADHD.

Dr. Steve Faraone, a professor at SUNY Upstate Medical University, told Reuters Health that doctors have dramatically improved their ability to help babies survive at shorter and shorter lengths of pregnancy, "which could mean that this particular risk factor is increasing over time."