The Obama administration indicated Monday that it would end its legal battle to block the “morning-after” pill from being available over the counter without age restrictions.

Just weeks after vowing to fight District Judge Edward Korman’s April ruling to eliminate previous age restrictions, the Justice Department told a court of plans to drop its appeal if the court approves its plan for compliance.

When finalized, the move would end a long-running dispute over emergency contraception dating back to the early years of George W. Bush’s presidency — a legal fight that forced the Obama administration to take a position on the availability of the controversial product in late 2011, just as the 2012 election fight was heating up — and make “Plan B” pills readily available on the shelves of drug stores nationwide.

It would also reverse the Obama administration’s longstanding insistence that access be limited to those age 17 or older — a controversial decision initially made by Health and Human Services Secretary Kathleen Sebelius, and supported by the president.

The position, which bucked the FDA’s recommendation that the pills be available to people of all ages, drew public outcry from Democrats, abortion rights advocates and medical groups such as the American College of Obstetricians and Gynecologists.

The administration’s new plan for compliance includes asking both Plan B manufacturer Teva Pharmaceuticals and the maker of a generic version of the pills to submit new drug-label applications to allow the products to be sold without age restrictions.

Once those applications are received, the Justice Department said, it’s expected that the Food and Drug Administration will approve them “without delay.”

The administration had previously signaled that it would challenge Korman’s April ruling ordering the elimination of all age restrictions for purchase of the morning-after pill within 30 days. The FDA responded by easing its restrictions to age 15 and up — but that did not satisfy Korman, of the Eastern District of New York, who said last week that he would order the immediate unrestricted sale of a two-pill version of emergency contraception.

In rejecting the administration’s requests, Korman said the government’s push to maintain age restrictions was ‘‘politically motivated, scientifically unjustified and contrary to agency precedent.’’

Advocates of Plan B and other forms of emergency contraception argue that they’re safe for women of any age, and should be available to all.

Planned Parenthood’s president, Cecile Richards, praised the administration’s decision to back away from its challenge as “a huge breakthrough for access to birth control and a historic moment for women’s health and equity.”

“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,” Richards added. “We encourage manufacturers of emergency contraception to request new labeling quickly and for the FDA to approve all such applications immediately to finally make this birth control option available without restrictions.”

Nancy Northrup, the president of the Center for Reproductive Rights, said her group was “pleased” with the administration’s move, which should make it possible for women to buy morning-after pills “without the arbitrary restrictions that kept it locked behind the pharmacy counter when they needed it most urgently.”

Opponents say the pills should not be sold on drug store shelves as freely as aspirin. Monday night, they slammed the administration’s reversal as politically-motivated.

“Our concern is that the government is not putting the health and safety of girls before political pressure,” said Anna Higgins, director of the Family Research Council’s Center for Human Dignity.

“Because [girls] can access this on their own if they’re in trouble or they’re at risk for some kind of sexually transmitted infection, they’re going to be bypassing essential screenings at doctors’ offices because they don’t have to go anymore…” said Higgins. “They’re also going to be avoiding getting guidance from parents on these very important issues because they don’t require parental consent.”

Marjorie Dannenfelser, president of Susan B. Anthony List, called the decision a “post election reality check.”

“This is a dangerous about-face for the Obama administration which previously seemed to agree that requiring a doctor’s prescription for potentially dangerous drugs was simply common sense,” she said in an email. “This decision endangers young girls by removing the protection that comes along with doctors and parents. Only abortion extremists rejoice at this news which has nothing to do with the health of children.”