(CNN) An Arizona woman has criticized Walgreens on social media, saying a pharmacist at the chain refused to fill her prescription for a medicine prescribed to induce miscarriage after she was told her 9-week-old fetus had stopped developing.

Walgreens says it allows pharmacists to step away from filling a prescription "for which they have a moral objection," but that they are required to "refer the prescription to another pharmacist or manager on duty to meet the patient's needs in a timely manner." The woman, Nicole Mone Arteaga, said she was later able to pick up her prescription from another Walgreens store.

"Each week I went for my ultra sound praying to see progress and hear the sound of little heartbeat. Unfortunately, development isn't happening and my body is slowly getting ready to miscarry. My (doctor) gave me two choices D & C or a prescription that will help induce bleeding and discharge in the comfort of my home," she wrote.

"D&C," also known as dilation and curettage, is a surgical procedure to remove tissue from the uterus . In the case of a fetus failing to develop, it is performed to prevent infection or heavy bleeding.

Walgreens apologizes

Walgreens said in a statement Monday that it is looking into the matter "to ensure our patients' needs are handled properly."

"After learning what happened, we reached out to the patient and apologized for how the situation was handled. To respect the sincerely held beliefs of our pharmacists while at the same time meeting the needs of our patients, our policy allows pharmacists to step away from filling a prescription for which they have a moral objection. At the same time, they are also required to refer the prescription to another pharmacist or manager on duty to meet the patient's needs in a timely manner," Walgreens said in a statement emailed to CNN.

'I left Walgreens in tears'

Arteaga said she left Walgreens in tears after a pharmacist refused to let her pick up her prescription to induce miscarriage.

"Last night I went to pick up my medication at my local Walgreens only to be denied the prescription I need. I stood at the mercy of this pharmacist explaining my situation in front of my 7 year old, and five customers standing behind only to be denied because of his ethical beliefs," she wrote in a Facebook post Friday.

"I get it we all have our beliefs. But what he failed to understand is this isn't the situation I had hoped for, this isn't something I wanted. This is something I have zero control over."

In comments on CNN, Arteaga said she felt a sense of helplessness when the pharmacist said he wasn't going to fill the prescription.

"The world felt like it was closing in and I was thinking, this is my body and I'm losing control," she said.

"I couldn't control the fact that my body wasn't going to support this pregnancy. And I wanted this baby. I couldn't control what my body was doing and now here I am trying to make my decision and what I'm going to do, and this person was taking that away from me and making that choice for me."

Woman who was denied medication by pharmacist to induce miscarriage speaks out: "All I could feel was helplessness... I was thinking, 'This is my body, and I'm losing control.'" https://t.co/Ao3Y8Cp47d https://t.co/yV9OpbH8Uu — CNN Newsroom (@CNNnewsroom) June 25, 2018

Arteaga described her miscarriage as an emotional roller coaster and said the pharmacist had "no idea what it's like to want nothing more than to carry a child to full term and be unable to do so."

"I left Walgreens in tears, ashamed and feeling humiliated by a man who knows nothing of my struggles but feels it is his right to deny medication prescribed to me by my doctor," she said.

Arteaga said she would not usually share such a story but did not want other women to have the same experience at a time "when you are vulnerable and already suffering."

In an update to her post, Arteaga said she later received an email notification that her prescription was ready at a different Walgreens location. She said she collected it after first revisiting her doctor to ensure he could help her fill the script.

Arteaga said she spoke to a store manager "who did not seem happy about what had happened" and had also contacted Walgreens corporate office.

"I have filed a complaint with the Arizona Board of Pharmacy. At this time I have done what I can to report the situation. Thank you to those who have shown love and support," she said.

By early Monday, her post had been shared more than 30,000 times and liked more than 55,000 times.

Walgreens policy

On Twitter, a user asked Walgreens Saturday: "What is your policy regarding dispensing prescribed medication? (Do) your pharmacists have the right to refuse service based upon their religious beliefs? Do they work for Walgreens or for themselves?"

The chain tweeted in response: "Our policy allows pharmacists to step away from filling a prescription for which they have a moral objection. At the same time, they are also required to refer the prescription to another pharmacist or manager on duty to meet the patient's needs in a timely manner."

Our policy allows pharmacists to step away from filling a prescription for which they have a moral objection. At the same time, they are also required to refer the prescription to another pharmacist or manager on duty to meet the patient's needs in a timely manner. — Walgreens (@Walgreens) June 25, 2018

Under state law, Arizona pharmacies must require employees to notify them of drugs they would decline to fill because of "sincerely held religious beliefs."

"On receiving this notification, the pharmacy must attempt to accommodate the employee if the accommodation can be made without causing undue hardship to the pharmacy or its customers."

If customers ask for drugs not in stock, the pharmacy must make efforts to ensure the script is filled in a timely fashion.

"A pharmacy must treat each customer with respect and dignity, make good faith efforts not to embarrass or demean the customer and attempt to ensure a seamless delivery of prescription services..." the law states.