If you get pulled over for speeding in Minnesota, it's increasingly likely the police officer will give you a choice: Pay the ticket, or take a safe driving class.

The classes usually cost less than the ticket, and the violation doesn't go on your driving record. More cities and counties are offering these "diversion programs" because they keep cases from entering the court system.

A new state auditor's report, though, says there's a problem with these programs: They're illegal.

"We don't want somebody with bad driving behaviors to be able to participate in diversion programs around the state and nobody knows how many they've participated in," said State Auditor Rebecca Otto. "If someone gets to participate in diversion in one county that's doing this program, and then the next day they're in a different city that has this program, their driving records are scattered all over."

There's nothing in state law authorizing local governments to set their own driving regulations, said Otto. Attorney General Lori Swanson agrees.

The view's different, though, in sheriff's offices and police departments across the state using diversion programs.

In Buffalo, Minn., the city started its Drive Smart program. Only people cited for minor moving violations -- such as going 15 miles or less over the speed limit, running a red light, failing to yield - are eligible.

"I would challenge the state to find another program that they're in charge of that has those kind of results."

The typical traffic ticket for that sort of violation is about $130, said Buffalo Police Chief Mitch Weinzetl. The Drive Smart class costs just $75. While the choice seems obvious, the course evaluations people fill out after they complete the class are almost all positive, Weinzetl said.

"These are people who didn't want to be there, who aren't happy to be held accountable," he said. They "had to pay money out of their pocket and had to spend two hours out of their life listening to an officer telling them about safe driving, and at the end of that session they're saying, 'Wow. This was really valuable to me.' I would challenge the state to find another program that they're in charge of that has those kind of results."

The number of programs like Drive Smart has nearly tripled over the last six years. More than 35 of them operate in cities and counties around the state.

Otto, though, says that results in a patchwork of rules.

"There's a range of fees. There's a range of classes you get to take if you're allowed to participate. One of them is an eight-minute online video that you watch."

But Wabasha County Sheriff Rodney Bartsh says there's nothing new or unusual about a prosecutor exercising discretion over whether to pursue a case.

"It's rooted in law that has allowed county attorneys to divert shoplifters, and divert other low-level offenders," he said. "They've been able to do it in other areas. We're not sure why they wouldn't be allowed to do it in this area."

The state's real motivation isn't about the law, Bartsh said. It's about money.

Wabasha County established its Safe Driving Class 10 years ago, and since then the program has generated more than $400,000. All of it stayed in the county.

With traffic tickets, the state gets about a third of the money. If a court orders someone to take a safe driving class, the state gets a $75 cut of the tuition.

The state auditor's office found local governments have collected about $1.6 million from safe driving programs over the last three years. Only two cities -- Coon Rapids and Red Wing -- shared any of that money with the state.

Attorney Erick Kaardal is suing Wabasha County over the program.

"It's very troubling when you observe the rule of law being ignored in such a forthright way when it comes to money," he said. "We'll never get to eliminating wasteful spending, if we can't eliminate illegal spending."

Kardaal notes that the Minnesota Attorney General's Office first raised questions about the legality of such programs as early as 2003, but no one took steps to shut them down.