CVS Health plans to begin offering next-day delivery of prescriptions and retail merchandise from its nationwide network of more than 9,700 stores, marking a potentially preemptive strike at Amazon as the online giant weighs entry into the pharmacy business.

CVS CEO Larry Merlo said Monday that the company would begin offering the service in 2018.

Stores in Miami, Boston, Philadelphia, Washington, D.C. and San Francisco will offer same-day delivery, he said.

The move comes as Amazon is said to be considering selling prescription drugs, which would require navigating a complex thicket of regulatory approvals but would represent a significant threat to CVS.

It also comes as CVS grapples with declining in-store sales as many of the retail products the company sells are contracting.

The company will also offer free, same-day from all of its locations in Manhattan starting Dec. 4.

A division that manages prescription benefits helped offset a declining in-store performance in the third quarter for the drug-store chain.

CVS on Monday reported slightly better-than-expected revenue and profit for the period but stayed tight-lipped its rumored talks to acquire health insurance giant Aetna.

CVS recorded third-quarter revenue of $46.18 billion, up 3.5%. That narrowly edged S&P Global Market Intelligence expectations of $46.17 billion.

Hurricanes Harvey, Irma and Maria took a $55 million bite out of the company's earnings, mostly in the form of payments in insurance deductibles, Merlo said on a conference call. Some 925 CVS locations were closed at some point because of the storms.

The company's pharmacy services division, which manages drug benefits as an intermediary between insurers and drug companies, grew into an even bigger part of its business in the third quarter.

That unit's sales rose 8.1% to $32.9 billion as prescription volume, mail orders and specialty drugs increased.

The way CVS reports its results, its pharmacy services division overlaps with its retail segment, whose revenue was down 2.7% to $19.6 billion.

Sales at CVS stores open at least a year, a metric viewed as a vital gauge of a retailer's health, declined 3.2%.

CVS said its same-store sales were hurt by an increase in generic drugs, lower insurance reimbursement rates, an intentional move to cut store discounts and less foot traffic.

Facing the potential entry of online giant Amazon into the pharmacy business, CVS is said to be considering a massive offer to buy Aetna, which recently abandoned a proposed tie-up with Humana amid regulatory pressure.

A deal with Aetna would give CVS a hand in most major elements of the health care business, including insurance, pharmacy benefit services, sales and even clinical care.

CVS did not comment on a prospective Aetna accord Monday.

The company's net income fell 19.8% to $1.29 billion, edging S&P Global Market Intelligence expectations of $1.28 billion.

CVS stock increased 0.5% in pre-market trading to $69.60.