(NBC NEWS) -- In a landmark ruling, a federal judge says the government must make the morning after pill available to all ages, without requiring a prescription for those under age 17.
The ruling also says the pills must be moved from behind pharmacy counters to store shelves.
In 2011, the Food and Drug Administration had planned to lift age limits, but Health and Human Services Secretary Kathleen Sebelius overruled the recommendation, citing health concerns for young girls.
President Obama supported her decision.
"He supports that decision today. He believes it was the right common sense approach on this issue," said White House spokesman, Jay Carney.
Friday's ruling says the government's refusal to allow access to the pill was arbitrary, capricious and unreasonable.
He ordered the FDA to lift the age restrictions within 30 days, a move critics oppose.
"Our concern is that this ruling really negatively affects the health and safety of young girls and it circumvents the rights of parents to be involved in important health decisions involving their daughters," said Anna Higgins of the Family Research Council.
It's part of a decade long battle over who should have access to the Plan B pill, which, if taken within 72 hours of unprotected sex, can reduce chances of pregnancy.
It prevents ovulation or fertilization of an egg, but has no effect if a woman is already pregnant.
The Justice Department said it will act promptly in deciding whether to appeal the decision.