When babies have an acute ear infection, they tug at their ears, get cranky and struggle to sleep through the night. Ear infections are the most common reason doctors prescribe antibiotics to children.

Because of the growing threat of drug-resistant bacteria, many physicians had hoped that a shorter course of antibiotics would be as effective as the standard 10 days of treatment for babies.

If five days did the trick, parents would benefit, too: It would cost less, and the inconsolable infant would be back to her old self and to day care more quickly — with possibly fewer days of nasty side effects, like diarrhea.

But a trial published in The New England Journal of Medicine on Wednesday dashed those hopes.

“Our intuition was that shorter courses would likely be as effective and lead to less antibiotic resistance, but neither of those proved to be the case,” said Dr. Donald H. Arnold, an associate professor of pediatrics and emergency medicine at Vanderbilt University School of Medicine.