ST. PAUL, Minn. (AP) - Minnesota’s lottery is primed to pull the plug on ticket sales over the Internet.

In a series of steps beginning Friday, the lottery will stop selling Mega Millions, Hot Lotto, Gopher 5, Powerball and instant-win tickets online. When the instant-win games launched in early 2014, Minnesota became the first state to give the scratch-off franchise a virtual option.

But state lawmakers were instantly uncomfortable, resulting in a law this spring that forced the lottery to stop those sales. The lottery could face legal repercussions from vendors that will see contracts terminated early.

Lottery director Ed Van Petten lost his fight to retain sales over the Internet, at gas pumps and through ATMs. He promoted them as a way to connect the lottery with a wired younger generation and head off a slump in sales, which could mean less money for the state treasury and environmental programs supported by profits.

Van Petten now has to worry about a legal backlash if two vendors pursue damages. Scientific Games and Linq3 have said they could be out a combined $13.5 million, Van Petten said.

“They haven’t threatened to sue, but that’s an option they have,” he said.

Executives at the companies didn’t return emails or phone calls seeking comment about possible attempts to recover those dollars.

It’s the culmination of an 18-month push by Minnesota lawmakers to cut off the electronic sales. Legislators from both parties blasted the lottery for launching the games without explicit legislative consent and contended it made gambling too convenient. A first attempt to scrap them ran into a veto by Gov. Mark Dayton, but he relented in the face of overwhelming votes in this spring’s session.

The new law gave the lottery four months to wind everything down. But the shutoff is coming with a month to spare.

Friday’s Mega Millions and Gopher 5 drawings will be the last where tickets can be purchased online in addition to brick-and-mortar locations. Powerball, other drawings and play-at-the-pump games run into the same fate Saturday. And the e-scratch tickets stop at noon Monday.

By mid-September any players that have money or winnings remaining in their individual accounts will get a check from the state.

Under the law, the lottery could have continued its subscription-based sales of tickets for the drawings. But the same vendors involved with those were part of the e-scratch tickets that drew much of the legislative opposition.

“We worked with our vendor to find a way to keep this program running, but we were unable to come to a mutually acceptable agreement,” the lottery informed players on its Web site.

Democratic Rep. Joe Atkins tried unsuccessfully to let the lottery keep the games until the current contracts ran out.

“The threat of a lawsuit doesn’t really bother me,” said Atkins, of Inver Grove Heights. “What bothers me more is breaking agreements with folks. There’s a certain honor that comes with those agreements. That troubles me.”

Van Petten said the lottery will consider restarting the subscription-based sales if there’s an appetite and workable route.

“We will look into it and determine the viability after we get this hurdle jumped,” he said.