WASHINGTON/CHICAGO (Reuters) - Harley-Davidson Inc HOG.N agreed to pay a $12 million civil fine and stop selling illegal after-market devices that cause its motorcycles to emit too much pollution, the U.S. Justice Department said on Thursday.

A Harley-Davidson motorcycle is pictured at the Harley-Davidson Museum in Milwaukee, Wisconsin August 31, 2013. REUTERS/Sara Stathas

The settlement resolves government allegations that Harley sold roughly 340,000 “super tuners” enabling motorcycles since 2008 to pollute the air at levels greater than what the Milwaukee-based company certified to the U.S. Environmental Protection Agency.

Harley did not admit liability, and said in a statement it disagrees with the government’s position arguing that the devices were designed and sold to be used in “competition only.”

The company said the settlement represents “a good faith compromise with the EPA on areas of law we interpret differently, particularly EPA’s assertion that it is illegal for anyone to modify a certified vehicle even if it will be used solely for off-road/closed-course competition.”

An EPA spokesman said that the vast majority of these tuners were used on public roads.

According to the government, the sale of such “defeat devices” violates the federal Clean Air Act. Harley was also accused of selling more than 12,600 motorcycles that were not covered by an EPA certification governing clean air compliance.

The settlement calls for Harley to stop selling the super tuners by Aug. 23, and buy back and destroy all such tuners in stock at its dealerships. EPA said the modified settings increase power and performance, but also increase the motorcycles’ emissions of hydrocarbons and nitrogen oxides.

Harley must also deny warranty claims if owners continue to use the devices. An EPA spokesman said the company’s dealers are not part of this action, but “if they are tampering or selling defeat devices on their own, then they could be investigated independently in the future.”

Harley will also spend $3 million on an unrelated project to reduce air pollution, the Justice Department said.

“Given Harley-Davidson’s prominence in the industry, this is a very significant step toward our goal of stopping the sale of illegal after-market defeat devices that cause harmful pollution on our roads and in our communities,” John Cruden, head of the Justice Department’s environmental and natural resources division, said in a statement.

The announcement comes amid greater scrutiny on emissions and "defeat devices" by U.S. regulators after Volkswagen AG VOWG_p.DE admitted to using illegal software to evade U.S. emissions standards in nearly 600,000 U.S. vehicles.

“This settlement immediately stops the sale of illegal after-market defeat devices used on public roads that threaten the air we breathe,” said Cynthia Giles, assistant administrator for EPA’s Office of Enforcement and Compliance Assurance.

Harley must obtain a certification from the California Air Resources Board for any tuners it sells in the United States in the future. For any super tuners that Harley-Davidson sells outside the United States in the future, it must label them as not for use in the United States.

In a separate statement, the company said it has sold the product for more then 20 years under an accepted regulatory approach that permitted the sale of competition-only parts and said it believed it was legal to use in race conditions in the United States.

Harley shares closed down 94 cents at $53.54, or 1.7 percent. They had earlier fallen as much as 8 percent after news of the allegations had surfaced in a U.S. lawsuit filed in Washington, but before the settlement was announced.

Harley said last month that EPA had first sought information about after-market part issues in December 2009.

Pat Sweeney, a Harley-Davidson spokesperson, said the company did not have immediate details on how many units of inventory had to be bought back or destroyed, nor details on the cost.

EPA said it discovered the violations through a routine inspection and information Harley-Davidson submitted. EPA has been investigating after-market part emission issues for more than five years.

In 2012, Suzuki Motor Corp 7269.T paid an $885,000 fine to EPA for selling 25,458 all-terrain vehicles and off-road motorcycles because they were built to allow for the installation of an after-market part to increase horsepower and emissions.

Several other companies have paid fines to EPA in recent years for selling after-market parts to diesel truck owners to remove emission controls and boost horsepower and fuel efficiency.