The two largest US pharmacy chains will begin selling the prescription abortion pill, mifepristone, this month.

CVS and Walgreens said they will start distribution next week in a handful of states where abortion is legal.

Their move follows a decision by the US Food and Drug Administration last year allowing pharmacies to sell the pill.

The pill has been legal in the US since 2000 but was previously only accessible through clinics and hospitals.

The announcement by CVS and Walgreens on Friday also comes as the Supreme Court is set to weigh whether the pill could be acquired by mail without an in-person doctor visit.

Spokespeople from both CVS and Walgreens confirmed that they will begin selling the abortion pill in interviews with the New York Times on Friday.

Walgreens said it will start by providing the pill in a handful of pharmacies in New York, Pennsylvania, Massachusetts, California and Illinois.

Company spokesperson Fraser Engerman said it is part of a “phased rollout” to monitor quality, safety and privacy for both patients and pharmacy staff.

CVS’s spokesperson Amy Thibault said it will begin dispensing the pill in all of its pharmacies in Massachusetts and Rhode Island “in the weeks ahead”.

Both companies said they will focus on rolling out in states where pharmacists are allowed to dispense mifepristone, and will monitor prospects where there are legal challenges to abortion bans or limitations, like Kansas, Montana and Wyoming.

Mr Engerman said Walgreens will not “dispense in states where the laws are unclear”, in order to protect staff.

CVS said it will “monitor and evaluate changes in state laws” and will distribute the pill wherever it is legal to do so.

Abortion pills are already available in clinics, and in some states, can be prescribed through telemedicine and mailed to a patient.

With the pill being available through a retail pharmacy, it will give doctors the option to send a prescription to a CVS or Walgreens, where the patient can pick it up from a pharmacist.

Widespread access to the pill has been opposed by anti-abortion groups, who have sued the FDA in a bid to remove mifepristone off the market in the US.

The case will be heard by the Supreme Court later this month, after a federal appeals court ruled that the pill should remain legal, but should not be sent through the mail or prescribed through telemedicine.

If the US top court upholds that ruling, it would mean that patients would have to obtain the pill by visiting a clinic, doctor or pharmacy in-person.

Mifepristone is the first of the two-pill regimen recommended by the FDA to end a pregnancy. Its use was first approved in the year 2000.

It works by blocking a hormone called progesterone, which is necessary for a pregnancy to continue. The second drug, misoprostol, empties the uterus.