A SCHOOL BUS company agreed to pay $165,000 in fines and court costs to settle charges that its drivers routinely allowed their diesel-powered buses to idle for as much as 20 minutes outside schools in New Bedford in violation of several anti-idling statutes.

Attorney General Maura Healey’s office, which negotiated the settlement with Tremblay’s Bus Co. of New Bedford, also sent letters to school superintendents across the state alerting them to the anti-idling law. The office also reached out to the public for help in finding other bus companies operating in violation of the law, setting up a website where people can leave tips about school buses idling illegally.

“Our office, through the work of our Clean Air Initiative, is dedicated to protecting environmental justice communities in Massachusetts from air pollution hazards and will take action against companies that violate our laws,” Healey said in a statement.

Massachusetts laws prohibit school bus drivers from idling buses for longer than five minutes and within 100 feet of school grounds, with the exception of during very cold or hot weather and where the layout of the school requires buses to wait in line for pickups.

According to Healey’s office, “inhaling diesel exhaust can cause cancer, aggravated asthma, lung damage, and other serious health problems and is especially harmful to children, whose lungs are not yet fully developed.”

Under the settlement, Tremblay denied the allegations and refused to admit liability, but the company did agree to pay a penalty of $100,000 split equally between the Friends of Buttonwood Park and the Greater New Bedford Community Health Center. The park’s share of the funds will go for tree planting and the health center will use its money for youth asthma prevention efforts.

Tremblay, which operates more than 250 school buses in southeastern Massachusetts, agreed to pay $45,000 to cover costs incurred by Healey’s office and another $20,000 for a civil fine that will be suspended and eventually waived if the company remains in compliance with idling regulations  for two years.

Officials at Tremblay did not immediately return phone calls. The mayor of New Bedford, Jon Mitchell, could not be reached for comment.