PHILADELPHIA (CBS/AP) — CVS Health is expanding same-day prescription deliveries nationwide in the latest push by drugstores to keep customers who don’t want to wait and are doing more shopping online. The drugstore chain says it can deliver medications and other products within a few hours to homes or offices from 6,000 locations.

The company started this service, which comes with a fee, in late 2017 in New York and expanded it to several cities last year.

“A year ago CVS Pharmacy redefined convenience for customers by introducing prescription delivery nationwide in order to extend the connection that our trusted, local pharmacists provide to their customers at our nearly 10,000 locations around the country,” said Kevin Hourican, president of CVS Pharmacy. “Today we’ve taken another step forward by expanding same-day delivery nationwide and enhancing the experience with our On-Demand delivery service.”

Hahnemann University Hospital Laying Off Nearly 200 Employees

Rival Walgreens Boots Alliance Inc. also offers same-day deliveries in major cities and plans to expand this year. It has a partnership with FedEx Corp. to provide next-day deliveries as well.

Drugstores have been dealing with competition from online giant Amazon.com, which offers its Prime customers same-day delivery for detergent, toothpaste and 3 million other products nationwide. Amazon also bought last year the online pharmacy PillPack, which provides home deliveries. But the retailer has yet to detail what it plans to do with that business.

CVS and Walgreens built thousands of drugstores nationwide to get closer to customers before online shopping exploded in popularity and started hurting their in-store business. They’ve since pivoted to adding more health care services and higher-margin beauty products to their stores while also trying to make their business more inviting to shoppers who buy online without leaving home or work.

Woonsocket, Rhode Island-based CVS Health Corp. said Thursday that customers will be able to order the same-day service through the company’s app, or by sending a text or calling the pharmacy. Aside from prescriptions, customers also can have items like cold remedies, vitamins and baby products delivered.

CVS will provide the service through the delivery company Shipt in 36 states and Washington, D.C. It costs about $8, or a few more dollars than an option the company also offers nationally to have things delivered in one to two days. For same-day deliveries, orders have to be placed a few hours before the store closes.

Bottle Of Wine A Week ‘As Bad As 5-10 Cigarettes’ For Cancer Risk, Study Finds

A CVS Health spokeswoman said Shipt will deliver the prescriptions in secure packaging to assure privacy.

Aside from running drugstores, CVS Health also fills more than a billion prescriptions annually for employers, insurers and other clients as one of the nation’s biggest pharmacy benefit managers. The company also spent about $69 billion to buy Aetna, a health insurer that covers more than 22 million people.

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)