The government is moving the morning-after pill over the counter, but only those 15 and older can buy it — an attempt to find middle ground just days before a court-imposed deadline to lift all age restrictions on the emergency contraceptive.

Plan B One-Step is sold behind pharmacy counters, and buyers must prove they’re 17 or older to buy it without a prescription. Tuesday’s decision by the Food and Drug Administration lowers the age limit and will allow the pill to sit on drugstore shelves next to spermicides or other women’s health products and condoms — but anyone who wants to buy it must prove their age at the cash register.

Some contraceptive advocates called the move promising.

“This decision is a step in the right direction for increased access to a product that is a safe and effective method of preventing unintended pregnancies,” said Sen. Patty Murray, D-Wash. “It’s also a decision that moves us closer to these critical availability decisions being based on science, not politics.”

But earlier this month, U.S. District Judge Edward Korman of New York blasted the Obama administration for imposing the age-17 limit, saying it had let election-year politics trump science and was making it hard for women of any age to obtain the emergency contraception in time. He ordered an end to the age restrictions by Monday.

The women’s group that sued over the age limits said Tuesday’s action is not enough, and it will continue the court fight.

Lowering the age limit “may reduce delays for some young women but it does nothing to address the significant barriers that far too many women of all ages will still find if they arrive at the drugstore without identification,” said Nancy Northup, president of the Center for Reproductive Rights.

The FDA said the Plan B One-Step will be packaged with a product code that prompts the cashier to verify a customer’s age. Anyone who can’t provide such proof as a driver’s license, birth certificate or passport wouldn’t be allowed to complete the purchase.

“These are daunting and sometimes insurmountable hoops women are forced to jump through in time-sensitive circumstances, and we will continue our battle in court to remove these arbitrary restrictions on emergency contraception for all women,” Northup said.

Half the nation’s pregnancies every year are unintended, and doctors’ groups say more access to morning-after pills could cut those numbers. The pills contain higher doses of regular contraceptives, and if taken within 72 hours of unprotected sex, can cut the chances of pregnancy by up to 89 percent.

The FDA had been poised to lift all age limits and let Plan B sell over the counter in late 2011, when Health and Human Services Secretary Kathleen Sebelius, in an unprecedented move, overruled her own scientists. Sebelius said some girls as young as 11 are physically capable of bearing children but shouldn’t be able to buy the pregnancy-preventing pill on their own.

President Barack Obama supported Sebelius’ move, and a spokesman said earlier this month the president’s position hadn’t changed.

The FDA said Tuesday’s decision was independent of the court case. Instead, after the Obama administration’s 2011 action, Plan B maker Teva Women’s Health had filed a new application with the age-15 compromise.