Air quality in Massachusetts and the nation continues to improve, but many residents still breathe air that could be harmful to their health, according to a new report.

Bristol and Essex counties received failing grades for ozone concentrations in the American Lung Association’s 2017 “State of the Air” report, which analyzed air quality data for the years 2013, 2014 and 2015.

That is a significant improvement from last year, when seven of 13 counties rated received “F” grades for ozone based on the association’s stringent grading metric. Middlesex Country received a "D" grade for high ozone days in last year's report, and a "C" grade this year.

The Boston-Worcester-Providence area ranked 37th worst out of 228 metropolitan areas in the 2017 report for the number of days when ozone concentrations were considered too high. The region averages more than five high-ozone days per year, but that's down from more than 30 high-ozone days per year in the mid-1990s.

Vehicle emission and fuel economy standards, a shift away from coal-powered electricity, and a federal cap-and-trade program targeting acid rain have led to improved air quality in recent decades, said Larry McKenna, associate professor of physics and earth science at Framingham State University.

“It’s not a question of is there less, it’s a question of is there little enough,” said McKenna, co-director of the university's Center for Climate Change Education.

In response to the report’s release, a spokesperson for the Massachusetts Department of Environmental protection emphasized on Wednesday that outdoor air throughout Massachusetts remains in compliance with federal health standards.

“With Massachusetts’ current programs that address and reduce ozone and fine particle pollutants from the transportation, power-generation and other sectors, the Department is committed to remaining under the federal standards,” DEP spokesperson Ed Coletta said in an email.

The association acknowledges it holds states to a higher standard. No Massachusetts county received higher than a “C” grade for ozone, even though some averaged just one high-ozone day per year.

“Even one day of harmful air is very dangerous for those with lung disease,” said Casey Harvell, the association’s Massachusetts public policy director. “Basically on those days you’re telling seniors, those with lung diseases, that they probably shouldn’t go outside.”

High ozone pollution days by county, 2013-2015:

The association used available federal, state and local air quality data to analyze ground-level ozone (smog) and particle (soot) concentrations nationwide.

Between 2013 and 2015, Middlesex and Worcester counties experienced the fewest days (three each) when ozone concentrations were measured at levels considered unsafe for those with respiratory issues.

In the same period, Essex County had 14 high-ozone days while Bristol County had 11 high-ozone days, including two when concentrations were high enough to be deemed unhealthy for the general population.

There were no days when short-term particle pollution – a separate measurement from ozone – was higher than the federal standards anywhere in Massachusetts during the time period, although half had incomplete or missing data.

“We are in compliance with the federal guidelines, but that still keeps us at an unhealthy level,” Harvell said about Massachusetts. “That’s why we do our grading, just to let the public know that while things have improved, there is still cause for concern.”

Research shows exposure to unsafe levels of ozone pollution can shorten lifespans and harm cardiovascular and respiratory health, while even one-time exposure can threaten those suffering from asthma and other lung conditions, according to the association.

Nationwide, the association says 125 million people are still breathing air considered unhealthy by their standards – but that’s a nearly 25 percent decrease from last year’s report.

In Massachusetts, 1.3 million people – including more than 200,000 individuals living with asthma, COPD or lung cancer – reside in Bristol and Essex counties, which received failing marks.

The 1970 Clean Air Act dramatically improved air quality in the United States, but association members are concerned about the Trump administration's proposed EPA budget cuts and opposition to the Obama administration's Clean Power Plan, Harvell said.

"We think at this day and age, knowing what we know and knowing the health impacts of this, we should be doing everything we can to improve air quality," Harvell said. "Really we want the public to be aware that this is important, that we wouldn’t want to see any regulations weakened."

Massachusetts joins eight other northeast states in the Regional Greenhouse Gas Initiative, which caps emissions for power plants, charging the companies for exceeding them.

With states in the process of re-evaluating the program, some environmental advocates are pushing to double the speed at which the emission cap decreases, from 2.5 percent to 5 percent annually, said Ben Hellerstein, state director of Environment Massachusetts.

A January 2017 report by the research group Abt Associates credited the regional initiative with saving between 300 and 830 lives and preventing more than 8,200 asthma attacks since 2009, by reducing air pollution from fossil-fuel power plants.

“We know that our dependence on dirty energy is not only changing our climate and throwing the future of our planet into risk, but also is causing illnesses and even premature death in our communities right now,” Hellerstein said.

Note: This story has been updated to correct the ozone grade Middlesex Country received in last year's "State of the Air" report.

Jonathan Dame can be reached at 508-626-3919 or jdame@wickedlocal.com. Follow him on Twitter @DameReports