For Mr. Obama’s administration, the decision to appeal the judge’s ruling provides an opportunity to reaffirm a moderate position in the broader abortion debate that had drawn praise from conservative groups that are normally highly critical of the president.

The appeal also reinforces Ms. Sebelius’s original 2011 decision, which proved to be very good politics for Mr. Obama at the time. Facing a difficult re-election battle, the Democratic president enthusiastically supported Ms. Sebelius, saying that as a father of two young daughters, he thought it was the right call to have made.

“And I think most parents would probably feel the same way,” he added.

Wednesday’s announcement came a day after the F.D.A. said one well-known morning-after pill, Plan B One-Step, would be made available without a prescription for girls as young as 15 — instead of only to girls ages 17 and over, as has been the case. That decision also will make the drugs more accessible by putting them on the shelves with other over-the-counter medications.

The Justice Department’s action will not affect that F.D.A. decision. Instead, the department is seeking to overturn a much broader order by the judge that removed restrictions for all ages and for generic versions of the pill, not just Plan B One-Step. The order, issued on April 5 by Judge Korman, gave the F.D.A. 30 days to comply.

On Wednesday, the Justice Department also asked Judge Korman to stay his order pending the results of the appeal.

In his ruling, Judge Korman said the Obama administration had put politics before science in restricting access to the drug. At the time, Ms. Sebelius said the pill had not been studied for safety in girls as young as 11. But advocates on both sides of the highly divisive issue of emergency contraception interpreted her decision in a political context, particularly since it fell during a presidential campaign cycle.

In 2011, a decision to allow distribution of emergency contraceptives to very young girls might have sparked a firestorm of criticism from anti-abortion groups. And it might have made it more difficult for the president, politically, when it came to other battles over contraception, including an effort to require some religious institutions to provide contraception free of charge.