Smoking in public housing across the U.S. is about to get snuffed out. A nationwide ban on smoking in public housing facilities will take effect at the end of July, nearly two years after the rule was passed.

Starting July 31, U.S. Housing and Urban Development will prohibit the use of cigarettes, cigars and pipes in all public housing units and common areas, as well as any outdoor area within 25 feet of public housing grounds. The ban does not apply to e-cigarettes, snuff and chewing tobacco, although there may be restrictions on those in some areas.

HUD says about 228,000 public housing units under more than 600 local agencies have already gone smoke-free, and the new rule will wipe out smoking in more than 940,000 other units. Under HUD rules, tenants can be evicted after three smoking violations.

The ban was passed under the Obama administration in November 2016. HUD said the new policy would reduce health hazards from secondhand smoke and encourage residents to quit smoking.

Get Breaking News Delivered to Your Inbox Click here to view related media. click to expand

The Centers for Disease Control and Prevention estimated in 2014 that the smoking ban would save government housing agencies $153 million a year in repairs and health care costs, including $16 million for costs tied to smoking-related fires.

For those who want help to quit smoking, officials recommend calling 1-800-QUIT-NOW (1-800-784-8669) toll-free to talk to a trained coach or go to www.smokefree.gov.