In a Tuesday, May 5, 2015 file photo, Volkswagen CEO Martin Winterkorn addresses the shareholders during the annual shareholder meeting of the car manufacturer Volkswagen in Hannover, Germany. Winterkorn apologized Sunday, Sept. 20, 2015, after the Environmental Protection Agency said the German automaker skirted clean air rules by rigging emissions tests for about 500,000 diesel cars. "I personally am deeply sorry that we have broken the trust of our customers and the public," Volkswagen chief Martin Winterkorn said in a statement. (AP Photo/Frank Augstein, File)

Volkswagen became the world's top-selling carmaker trumpeting the environmental friendliness, fuel efficiency and high performance of diesel-powered vehicles that met America's tough Clean Air laws.

VW's success story was so good that pollution-control advocates did their own tests, hoping to persuade other countries to enforce the same strict standards.

Instead, they got a foul-smelling surprise: In actual driving, the VWs spewed as much as 40 times more pollution from their tailpipes than allowed by the U.S. Environmental Protection Agency.

"We ran the program to show that U.S. diesels are clean," said John German, senior fellow with the International Council on Clean Transportation, the group that blew the whistle on Volkswagen. "Turned out we found a violator."

The EPA and the California Air Resources Board announced the violations on Friday, accusing VW of installing software that switches on pollution controls during smog tests, then switches them off again so that drivers can enjoy more engine power on the road.

VW got away with this scheme for seven years, and according to the EPA, didn't come clean even when repeatedly confronted with evidence of excessive pollution.

Industry analysts say the company was likely trying to reduce costs and improve performance, to match its marketing.

Instead, VW's stock plunged a stunning 17 percent on Monday, costing the company $15 billion in market value in a single day. It also outraged customers, turned up the heat on the CEO, and could bring up to $18 billion in penalties from the U.S. government alone.

The company stopped selling the vehicles and likely will have to recall nearly 500,000 Jetta, Golf, Beetle and Audi A3 cars dating to the 2009 model year.

CEO Martin Winterkorn promised a company investigation as he apologized on Sunday, saying VW had broken the trust of customers and the public. He also pledged to cooperate with government investigations.

U.S. diesel emissions limits, mainly for ozone-causing nitrogen oxide, are more strict than those in Europe. Removing the chemical requires additional hardware. Instead, VW used secret software—an algorithm that detects when cars are being tested on treadmill-like devices called dynamometers, and stealthily switches the engines to a cleaner mode.

In this photo taken Feb. 14, 2013, a Volkswagen logo is seen on the grill of a Volkswagen on display in Pittsburgh. The Environmental Protection Agency (EPA) says nearly 500,000 Volkswagen and Audi diesel cars built in the past seven year are intentionally violating clean air standards by using software that evades EPA emissions standards. (AP Photo/Gene J. Puskar)

Because smog tests are almost always done on dynamometers, VW got away with the scheme for seven years, until the "clean transportation" advocates went to West Virginia University, which tests emissions using equipment that fits in car trunks.

WVU tested three cars in real-world conditions— a 2012 VW Jetta, a 2013 VW Passat and a BMW X5 SUV. The BMW passed, but the university found significantly higher emissions from the Volkswagens, according to the EPA.

The university and the council reported their findings to the EPA and CARB in May 2014, but VW blamed the problem on technical issues and unexpected conditions. The automaker even did a recall late last year, without much improvement, the EPA said.

Only when the EPA and CARB refused to approve VW's 2016 diesel models for sale did the company explain what it had done.

"We met with VW on several occasions, and they continued to dispute our data, so we'd return to the lab," recalled CARB spokesman Dave Clegern. "Over time, VW had no other explanations left, and it was our lab staff who actually got VW to admit that there was, in fact, a defeat device."

VW's diesel cars represent just a fourth of its U.S. sales, so the company was probably trying to avoid the cost of more sophisticated pollution controls, since it sells far more diesels in Europe, said Alan Baum, a consultant in Detroit who advises automakers on fuel economy regulations.

"That enabled them to offer the diesel without some of the additional hardware and software in the U.S.," Baum said.

The scheme also gave VWs better mileage, German said.

The scandal is already damaging VW's reputation as the people's car. European regulators announced parallel investigations, and the EPA said it is expanding its probe to make sure other automakers aren't using similar devices.

In this Nov. 20, 2008 file photo a Volkswagen Jetta TDI diesel engine is displayed at the Los Angeles Auto Show. Green Car Journal named Volkswagen's 2009 Jetta TDI as the "Green Car of the Year" at the show on Thursday, making it the first clean-diesel vehicle to win the prize. Around 15 billion euros (US$ 16.9 billion) was wiped off the market value of Volkswagen AG on Monday, Sept. 21, 2015 following revelations that the German carmaker rigged U.S. emissions tests for about 500,000 diesel cars. (AP Photo/Damian Dovarganes)

VW board members reportedly planned a crisis meeting Wednesday ahead of their regular board meeting. And at the White House, spokesman Josh Earnest said "we are quite concerned by some of the reports that we've seen about the conduct of this particular company."

VW CEO Winterkorn will face difficult questions in the coming days.

"I'd be surprised if Winterkorn can ride this out, but in Germany there's often a slightly slower process in these matters," said Christian Stadler, a professor of strategic management at Warwick Business School.

For a company to engage in such blatant trickery, top executives must have been informed, said Guido Reinking, a German auto expert.

Winterkorn is an engineer by training who led research and development across the VW group beginning in 2007, and became chairman of the management board the same year.

The illegal software was made and installed in vehicles with 2.0-liter diesel engines during the model years 2009 through 2015, the EPA said.

Car owners do not need to take any immediate action. The cars threaten public health, but the violations pose no safety hazards, and the cars remain legal to drive and sell while Volkswagen comes up with a plan to repair them at company expense, the EPA said.

VW didn't acknowledge its scheme until Sept. 3, EPA spokeswoman Liz Purchia said Monday. On Sept. 9, without making any reference to VW, the Justice Department announced a renewed commitment to holding individual executives accountable for corporate wrongdoing. And when the EPA announced VW's violations on Friday, it noted that in addition to the corporate fines of $37,500 per vehicle, individuals could be fined $3,750 per violation of the Clean Air Act.

On Capitol Hill, House Energy and Commerce Committee Chairman Fred Upton, R-Mich., said his subcommittee will determine whether auto buyers were deceived. "The American people deserve answers and assurances that this will not happen again. We intend to get those answers."