CVS, the nation’s second-largest drugstore chain, is kicking the habit of selling tobacco products as it continues to shift its focus toward being more of a health care provider.

The company said Wednesday that it will phase out cigarettes, cigars and chewing tobacco by Oct. 1 in its 7,600 stores nationwide, in a move that will help grow its business that works with doctors, hospitals and others to improve customers’ health.

The move is the latest evidence of a big push in the drugstore industry that has been taking place over several years. Major drugstore chains have been adding in-store clinics and expanding their health care offerings. Their pharmacists deliver flu shots and other immunizations, and their clinics now manage chronic illnesses like high blood pressure and diabetes and treat relatively minor problems like sinus infections.

Among other things, they’re preparing for increased health care demand. That’s in part due to an aging U.S. population that will need more care in future years. It’s also the result of the millions of people expected to gain health insurance under the health care overhaul.

As CVS has been working to team up with hospital groups and doctor practices to help deliver and monitor patient care, Chief Medical Officer Dr. Troyen A. Brennan said the presence of tobacco in its stores has made for some awkward conversations.

“One of the first questions they ask us is, ‘Well, if you’re going to be part of the health care system, how can you continue to sell tobacco products?’” he said. “There’s really no good answer to that at all.”

CVS Caremark Corp., which has 7,600 stores nationwide, said it will lose about $2 billion in annual revenue by phasing out tobacco, but the move will not affect its 2014 earnings forecast. CVS notches about $1.5 billion annually in tobacco sales, but it expects a bigger hit because smokers often buy other products when they visit their stores. The company brought in more than $123 billion in total revenue in 2012.

The company declined to say what will take tobacco’s prominent shelf place behind cash registers at the front of its stores. CVS will test some items and may expand smoking cessation products that are sometimes sold near cigarettes.

Its drugstores do not sell electronic cigarettes, devices that heat a liquid nicotine solution and create a water vapor that users inhale. CVS also plans to expand its smoking cessation efforts. That includes training pharmacists to counsel people on how to quit.

“We’ve come to the conclusion that cigarettes have no place in a setting where health care is being delivered,” said CVS CEO Larry Merlo, who noted that many of the chronic conditions their clinics treat are made worse by smoking.

The company’s tobacco plan drew praise from President Barack Obama, who said the decision will help his administration’s efforts to reduce tobacco-related deaths, cancer, and heart disease, as well as lower health care costs.

Tobacco is responsible for about 480,000 deaths a year in the U.S., according to the Food and Drug Administration, which gained the authority to regulate tobacco products in 2009.

The federal government has renewed efforts to reduce the death and disease caused by tobacco use on the heels of the 50th anniversary of the landmark 1964 surgeon general’s report that launched the anti-smoking movement.