Some of the country's largest pharmacy retailers have restricted the amount of Plan B pills a customer can buy following a spike in demand for emergency contraceptive drugs in recent days.

The rise in demand for Plan B pills came after the Supreme Court ruled on Friday to overturn the landmark Roe v. Wade decision, which previously set a 50-year precedent for legal abortion in the U.S.

Rite Aid said it was restricting purchases of Plan B starting Tuesday due to high demand.

"Due to increased demand, at this time we are limiting purchases of Plan B contraceptive pills to three per customer," a spokesperson told ABC News in a statement.

Walmart officials said they were limiting purchases of the pills to 10 per online order. A company spokesperson told ABC News that "during times of fluctuating demand, these limits may change."

Amazon also confirmed to ABC News it was temporarily restricting emergency contraceptive purchases to three units per week and said the quantity limits started going into effect this past Monday.

A CVS spokesperson told ABC News that while CVS pharmacies had temporarily limited Plan B purchases to three at a time, given high demand, the company had since eased those restrictions as sales leveled off.

"Immediately following the Supreme Court decision, we saw a sharp increase in the sale of emergency contraceptives and implemented a temporary purchase limit to ensure equitable access," a spokesperson said. "Sales have since stabilized and we're in the process of removing the purchase limits, which will take effect in-store and on CVS.com over the next 24 hours. We continue to have ample supply of emergency contraceptives to meet customer needs."

Retailers may be implementing buying limits in an effort to curb people from stockpiling the drugs out of panic or with the intent of reselling them at a later date if supplies become harder to obtain.

Plan B, which stops pregnancy before it happens, is different from abortion-inducing pills. Morning-after pills are a type of emergency contraception that can be taken orally up to five days after intercourse -- though it is recommended that they be taken within 72 hours to be more effective.

Morning-after pills can be used when a birth control method fails, or if no birth control was used, according to the Centers for Disease Control and Prevention.

Levonorgestrel, the generic name of the drug used in Plan B, is sold over the counter under various brand names, including Plan B One-Step, AfterPill, Aftera, EContra One-Step, My Choice, My Way, Next Choice, Option 2, Preventeza and Take Action.

Another type of morning-after pill, ulipristal acetate, is sold under the brand name Ella and usually requires a prescription.