MEXICO CITY (AP) — Officials in the greater Mexico City area have been unable to stop corruption at vehicle emissions testing centers, so on Tuesday they announced a new program to inspect most cars by computer.

Inspection stations currently measure tailpipe emissions with a wand-like device, but inspectors have been found switching cars and results to help dirty vehicles pass.

Now, sensors will be plugged into a car's own onboard computers to get the vehicle's readings on its own condition. The process, already used in the United States, is supposedly more foolproof and will be supervised by a central processing station.

About two-thirds of the 5.4 million vehicles in the metropolitan area are 2006 or later models, which have onboard computers suitable for testing. The other one-third can still be tested by the tailpipe sensors.

The new rules announced Tuesday will exempt cars made in 2016 and later from twice-yearly emissions checks for as long as four years.

The rules are also intended to eliminate loopholes that have left heavily polluting trucks and buses largely unregulated. The government plans to establish remote sensors that can detect dirty vehicles from a distance.

The rules are scheduled to go into effect on July 1 for Mexico City, its suburbs and surrounding states. But Environment Secretary Rafael Pacchiano said similar new rules hopefully will be implemented nationwide later.

Mexico's Center for Environmental Law praised the new measures, particularly because they set tighter limits on emissions and require more buses, trucks and vehicles from surrounding states to get inspected.

But the center warned the measures alone wouldn't solve the problem. The center said Mexico's state-owned oil company, Pemex, needs to provide cleaner diesel fuel throughout the country to cut down on soot from trucks.

The new plan "should be accompanied by sustainable public transport, zoning, urban and air-quality policies, because by itself, it cannot solve the underlying problem."

Mexico City has a subway and bus system, but they can't handle the huge numbers of commuters. Many people use cars or older, more polluting private buses to get to work.

And urban sprawl caused by poor planning forces people to travel longer distances from home to work.

The city has been experiencing an upsurge in air pollution as more cars choke its streets and expressways. Authorities declared a special three-month program, set to run out at the end of June, to keep one-fifth of the city's cars off the streets on any given day. Despite that, the city has experienced several spikes in smog levels in recent weeks that have triggered driving bans on as much as 40 percent of the city's cars.