The Justice Department late Monday said it would drop its appeal of a judge’s decision mandating that the “morning-after” pill be made available to girls of all ages, reversing course and effectively giving the go ahead for over-the-counter sales of the drug.

Obama administration officials told U.S. District Judge Edward Korman they would drop their attempts to preserve age restrictions for Plan B, a move that drew immediate praise from reproductive-rights groups — and scorn from social conservatives.

Korman had already ruled that women, regardless of age, would have access to the drug until the appeal was decided.

The president had previously called for the pill to be made available to those 17 and older, lamenting that girls could buy the product “alongside bubble gum or batteries.”

Progressives hailed the reversal from Obama’s Justice Department.

“This is a huge breakthrough for access to birth control and a historic moment for women’s health and equity,” Planned Parenthood Federation of America President Cecile Richards said. “The FDA’s decision will make emergency contraception available on store shelves, just like condoms, and women of all ages will be able to get it quickly in order to prevent unintended pregnancy.”

But social conservatives blasted the Obama administration, saying the drug shouldn’t be sold next to other common medications.

Anna Higgins, director of the Family Research Council’s Center for Human Dignity, said she worried federal officials were “not putting the health and safety of girls before political pressure.”