RALEIGH, N.C. (WNCN) — A pair of foreign car makers will pay the North Carolina nearly $1 million for inflating gas mileage and fuel economy claims for some of their vehicles, according to the state attorney general’s office.

The payment is a condition of a settlement reached between Hyundai and Kia and the attorneys general of 35 states.

The investigation dated from 2012. An investigation by the U.S. Environmental Protection Agency and the California Air Resources Board showed the companies had failed to stick to required testing protocols, according to a news release from Cooper’s office. The car makers later changed the state fuel economy ratings for some vehicles from the 2011, 2012 and 2013 model years.

The numbers were posted in the windows of cars offered for sale and in high-profile advertisements.

“In one television commercial, Hyundai claimed that five of its models were rated at 40 miles per gallon, encouraging consumers to buy those vehicles during a time when gas prices were high,” the news release said.

Hyundai and Kia have also settled a separate class-action case with consumers.