Pharmacy giant CVS Health has agreed to buy Aetna in a $69 billion blockbuster acquisition that could rein in health-care costs and transform its 9,700 pharmacy storefronts into community medical hubs for primary care and basic procedures, the companies announced Sunday afternoon.

The pharmacy chain agreed to buy Aetna for about $207 per share, broken down into $145 in cash and the rest in stock. The deal — the biggest health-care merger announced in more than a year — is expected to close in the second half of 2018, subject to approval by shareholders and regulators.

If approved, the megamerger would create a giant consumer health-care company with a familiar presence in thousands of communities. Aetna chief executive Mark T. Bertolini described the vision in an interview as “creating a new front door for health care in America.”

“We want to get closer to the community, because all health care is local,” Bertolini said. “What was going to draw people into an Aetna store? Probably not a lot. We looked for the right kind of partnership.”

CVS would provide a broad range of health services to Aetna’s 22 million medical members at its nationwide network of pharmacies and walk-in clinics, and further decrease the drugstore titan's reliance on the retail sales that have faced increasing competition.

“You can imagine a world where health care is better designed around the people who use it, which is one of the challenges we have today,” CVS chief executive Larry J. Merlo said in an interview. As part of the deal, Bertolini would join the CVS board and Aetna would be run as a stand-alone business unit.

The deal is likely to set off even more mergers in the health-care industry, which has been undergoing consolidation and faces potential new competition from Amazon.com. It could position Aetna to be more competitive with UnitedHealth Group, the nation's largest insurer, which has already expanded beyond its core business into pharmacy-care services, clinics and surgery-care centers and health-care data.

“I think it will create more consolidation among the insurers and retailers, blurring the lines,” said Ana Gupte, an analyst at Leerink Partners, who recently pointed to retail giants Walgreens Boots Alliance or Walmart as potential “dark horse acquirers” of the health insurer Humana.

Wall Street analysts have said the deal could lower health spending — if, for example, CVS can push customers to use walk-in clinics instead of emergency rooms for minor problems. But consumer advocates argue the deal would limit consumer choice and could make it even harder for new companies to enter into a market increasingly dominated by behemoth companies.

Even before the announcement, the familiar drugstore chain has been a dominant player in the big business of negotiating drug prices for insurers and employees. The merger would give CVS an even broader role in managing health care.

The combined company could leverage massive amounts of data from both Aetna's medical claims and CVS's vast number of touchpoints to consumers, including its 9,700 retail stores and 1,100 MinuteClinics.

CVS plans to transform its locations into a kind of community health hub, where pharmacists and nurses can provide follow-up and monitoring to patients recently released from the hospital — reviewing and managing their medications and helping them to stay out of the hospital. (Hospital re-admissions are seen as a major, avoidable cost in health care.)

The storefronts could also transform preventive care, offering wellness, nutrition, vision, hearing and other medical services — saving costs by keeping people healthier and providing care in a lower-cost setting than a hospital.

Pharmacists and nurses could help make sure patients with chronic diseases stay on their meds and provide counseling between doctor's visits, which would keep those conditions in control.

Bertolini and Merlo said the combination could fundamentally transform consumers' experience of health care. Traditionally, insurers put up obstacles, such as co-pays or paperwork that needs to be submitted by a doctor, to make sure that medical services and drugs aren't being misused. Those barriers could be eliminated or reduced as CVS pharmacists and nurses worked with the patient directly to make sure they were getting the right treatments and most effective care.

“Every health insurance company wants to get closer to the consumer,” said Dan Mendelson, president of Avalere Health, a consulting firm. “If a patient is better off by getting a home health visit to have someone go through their medications to take them off 10 and eliminate those medications, I want that to happen — as opposed to someone just filling prescriptions.”

The merger would also better insulate CVS and Aetna against looming competition on two fronts.

The mere possibility that Amazon will soon begin selling drugs has shaken the stocks of companies up and down the drug supply chain, from wholesalers to pharmacies. (Amazon's founder, Jeffrey P. Bezos, also owns The Washington Post.) The deal would expand CVS’s business beyond selling drugs and negotiating drug prices, to managing all aspects of a patient’s health — and could shift its storefronts to become medical hubs, rather than aisles stocked with consumer goods that people can easily buy in other stores or online.

The deal would protect against competition from health insurers, particularly UnitedHealth Group, that have brought the business of negotiating drugs in-house instead of buying services from a middleman. It will effectively cut out the middleman in negotiating drug prices for health insurers, because CVS is that middleman today, and lock in Aetna's medical members for the pharmacy management side of CVS's business.

The health-care space has already undergone considerable consolidation — but it has also faced challenges. Last year, two health insurance megamergers between Aetna and Humana and Anthem and Cigna crumbled under antitrust opposition. But a merger between companies that don’t directly compete is thought by many to have a better chance.

“They’re going to be able to offer you a better-functioning insurance package,” said Craig Garthwaite, associate professor of strategy at Northwestern's Kellogg School of Management. “There’s some sense in which we’re seeing a reshuffling of the organizational structure, such that insurers are owning providers.”

That fundamental restructuring is part of an industry-wide move away from managing different aspects of patient care — such as drugs or hospitalization — in isolation.

Martin Gaynor, a professor of economics and health policy at Carnegie Mellon University, said that while a CVS-Aetna merger doesn’t strike him as a deal that would clearly reduce competition, it wasn't clear why the companies needed to combine at all, because CVS already has Aetna's business as a pharmacy benefit manager.

“A big question mark for me is how does it make the merged company better?” Gaynor said. “I wonder about a lot of these mergers, whether they’re really driven by a true increase in the long-term value of the company — as opposed to seeking a short-term bump in stock prices.”

David Balto, a former policy director at the Federal Trade Commission who led a coalition opposing the insurance mergers, said that he thought the merger would reduce competition and harm consumers.

“For those people who have spent endless hours in long lines at CVS stores, trying to figure out how to meditate while standing, this merger is bad news. It means, increasingly, they’re going to be forced into those long lines. CVS doesn’t win points on service, and it's these kind of vertical relationships that raise prices, and deny choices for consumers,” Balto said.