Smoking in and near public housing will be banned at the end of July

(CNN) — Smokers won’t be able to light up in or near public housing starting July 31.

They’ll still be allowed to rent in the communities but will have to keep lit cigarettes, cigars and pipes at least 25 feet away from buildings. Electronic cigarettes will still be permitted.

The policy was announced two years ago by the Department of Housing and Urban Development, but the agency gave the nation’s more than 3,300 local public housing authorities nearly two years to begin enforcement.

The rule will be part of residents’ leases — along with information about how to quit smoking — and tenants who break it could be evicted, HUD has said. But eviction after just one violation “is not grounds for eviction,” and smoking on public housing premises is a civil violation, not a crime, the agency said in setting guidelines for local enforcement.

The federal ban will save public agencies an estimated $153 million every year in costs related to health care due to secondhand smoke, as well as repairs and losses from preventable fires, according to the Centers for Disease Control and Prevention.

The ban will affect more than 940,000 public housing units across the country, according to HUD. Through the agency’s voluntary policy and local initiatives, more than 228,000 public housing units were already smoke-free in 2016.

Along with promoting the health benefits of not smoking, HUD hopes the new rule will also “create healthy environments that encourage people who smoke to quit or attempt to reduce smoking,” the agency says.