CVS, the nation's second largest pharmacy chain, said Wednesday that it would stop selling all cigarettes and tobacco products nationwide by October, saying they have no place in a drugstore company that is trying to become more of a health-care provider.

The move is a bold and expensive one for CVS, a unit of Woonsocket, R.I.-based CVS Caremark Corp. It reflects a major push by retail pharmacies away from simply dispensing drugs toward a more integrated role of providing basic health services to Americans--including millions of newly-insured--amid an expected shortage of primary care doctors.

The news is another blow to the $100 billion tobacco industry that is wrestling with slumping sales, rising taxes, widening smoking bans and a resurgence of public information campaigns highlighting the perils of smoking.

For CVS, the move will be costly. The drugstore chain estimates it will lose $2 billion in annual revenue from tobacco and other sundries as a result, which amounts to about six to nine cents a share this year and about 17 cents annually from next year on. CVS, with annual revenue of more than $123 billion, projects its 2014 earnings will be $4.36 to $4.50 a share.

But it is banking the strategy will give it a competitive edge over rival pharmacies in forging partnerships with hospitals, insurers and physician groups. These types of alliances are critical to drugstores like CVS and Walgreen Co. as they redefine themselves in what has been a historic downturn in prescription drug sales.

CVS sees its future in making its in-store clinics a convenient health-care alternative to long waits at the doctor's office, along with CVS pharmacists counseling patients. That strategy was increasingly at odds with racks of cigarettes, cigars and chewing-tobacco residing behind the cashier's counter, said Larry Merlo, chief executive, in an interview.

"Cigarettes have no place in an environment where health care is being delivered," said Mr. Merlo, a 58-year-old former pharmacist who became CEO of CVS Caremark in 2011. "This is the right decision at the right time as we evolve from a drugstore into a health-care company."

CVS's move is expected to put pressure on its main rivals--Walgreen, Rite Aid Corp. and even Wal-Mart Stores Inc. to adopt similar measures. Each of those competitors, like CVS, is wooing sick patients with the promise they could help them better manage their health--and make sure they stay on their prescription medications.

"It just doesn't make sense, if you exist to promote health and you sell one of the major causes of death in the U.S.," said Otis Brawley, chief medical officer at the American Cancer Society.

That's bad timing for big tobacco. U.S. cigarette industry volumes are already in a yearslong tailspin and slipped an estimated 4% in 2013. The adult smoking rate in 2012 stood at 18.1% in 2012, down from 42% in 1965, according to the government.

But tobacco remains the No. 1 preventable cause of disease and death. New evidence suggests it is an even bigger killer than previously thought: A U.S. Surgeon General report last month linked smoking to 480,000 deaths annually, up from a previous estimate of 443,000 deaths. It attributed at least $289 billion in annual costs from smoking, including $150 billion for lost productivity and $130 billion in medical care.

Federal, state and local regulators are stepping up anti-tobacco efforts. The Food and Drug Administration is launching a $115-million, yearlong media blitz including television advertisements next week targeting teenage smokers. The FDA is also mulling curbs on menthol-flavored cigarettes and the White House last year proposed roughly doubling the federal excise tax on cigarettes.

Lawmakers in several states including Colorado and Vermont want to raise the legal smoking age to 21 years from 18 years, following in the footsteps of New York City. Some states including Kentucky and Alabama are weighing tax increases. A pack of cigarettes in Chicago already has $6.16 in state and local taxes, up from, $3.66 less than two years ago.

Pharmacies aren't the first place consumers go to buy a pack of smokes. Of the nearly 290 billion cigarettes sticks sold in the U.S. in 2012, 47.5% were purchased at gas stations, 21.1% in specialty tobacco stores and 15.9% in convenience stores, according to Euromonitor International. Pharmacies handled only 3.6% of volume.

Still, dropping tobacco products is a rare move by a big retailer. Target Corp. stopped selling cigarettes in 1996 because they weren't profitable and were too costly to stock. In 2008, Wegmans Food Markets Inc., a northeast supermarket chain, dropped tobacco products too, as a way to promote healthy lifestyles for consumers.

But CVS, with 7,600 stores across the nation, is the largest company to make such a move and the first national player to do so for explicitly public health reasons.

Some municipalities have balked at the incongruous combination of pharmacies and cigarettes. Since 2008, San Francisco and Boston and more than a dozen towns in Massachusetts have banned retail pharmacies from selling tobacco products.

Yet as recently as last year, a Walgreen spokesman told the Chicago Tribune the company didn't have similar plans. The spokesman said the company sold tobacco products to "stay competitive in the marketplace and offer the products and services our customers want and expect us to carry, even when we wish they were making healthier choices."

Like Walgreen, CVS has expanded its number of in-store clinics, staffed by nurse practitioners, where sick patients can get treated for a range of common conditions. CVS pharmacists are also encouraged to counsel patients on their health.

CVS has more than two dozen relationships with health systems across the U.S., including Cleveland Clinic and Emory Healthcare in Atlanta. But in the initial discussions, doctors immediately ask how CVS can still sell tobacco products, said Troyen A. Brennan, CVS Caremark's chief medical officer. "They're a little bit suspicious of us because we sell cigarettes," Dr. Brennan said. "This move gives us a competitive advantage because it shows our commitment to health care."

CVS is launching this spring smoking cessation programs at their pharmacies and in-store clinics--in effect, trading smokers for those people wanting to quit. About 7 of 10 smokers indicate they want to quit, with about half attempting to stop every year, and opportunities exist, especially with health insurers, for partnerships, Dr. Brennan said.

Subscribe to WSJ: http://online.wsj.com?mod=djnwires