Lottery officials this summer said they were surprised to learn that a handful of high-stakes gamblers had taken over one of their $2 games, with just three groups of bettors accounting for most of the winning tickets statewide at certain times. The lottery disciplined two sales agents who allowed the high-rollers to run the ticket machines themselves and announced new rules to limit the dominance of sophisticated bettors.

But the Globe has found that lottery managers for years allowed and some say even encouraged the groups to manipulate the game, Cash WinFall. They provided extra ticket machines and printers to accommodate the biggest player, a retired store owner from Michigan, so he could buy more tickets faster. Gerry Selbee, whose gambling group spent millions of dollars on the game, said the regional director in Western Massachusetts personally thanked him for propping up flat lottery sales.

In addition, it appears that an extraordinary lapse by lottery officials last year allowed a group led by an MIT computer whiz to single-handedly hijack the game, winning more than $2 million - nearly the entire jackpot from a single drawing.

Until then Cash WinFall had been a game for the knowing few, who quietly played the game and reaped its generous rewards. On Aug. 16, 2010, it was a game for one.

“It was either incompetence or collusion with someone [at lottery headquarters] in Braintree,’’ charged Selbee, who says the lottery has for years enabled, openly or tacitly, the gambling groups.

For six years, Selbee’s group and a few others dominated Cash WinFall during “rolldown weeks’’ when prizes swell to 5 to 10 times the normal amount. Their vast winnings came at the expense of regular bettors who play the game.

Under Cash WinFall rules, when the jackpot hits $2 million and no one wins, the prize money “rolls down’’ into the smaller prizes, which increase dramatically. Players can win by matching 2,3,4,5 or 6 of six drawn numbers. When the jackpot rolls down, for example, picking 5 of 6 numbers can generate a prize 10 times higher than the $4,000 it would yield in a regular week.

‘One would have to be brain-dead not to notice that the avalanche [in sales] had begun ’

Mohan Srivastava, Canadian statistician

Players are also drawn to the game in these periods because the odds of winning lower-tier prizes are relatively good - so good that statisticians say if groups bet enough money they will win more than they lose.

When the word goes out from the lottery, which normally alerts the public when a rolldown is going to occur, savvy gambling groups move in, pouring huge money into the game, generating steady profits for the lottery - and themselves.

But in August 2010, the Globe found, a group led by a 2007 MIT graduate named Yuran Lu found a way to win virtually all the prizes themselves.

Instead of waiting for the jackpot to grow enough for the lottery to predict a $2 million jackpot, Lu decided to quietly buy up enough tickets to force a rolldown himself - without the lottery or any other regular Cash WinFall players seeing it coming.

The lottery remained silent as Lu stockpiled 700,000 tickets. The lottery did not announce the rolldown to the public and no one but Lu’s group poured big money into the game. Because the public and the other betting groups sat on the sidelines, the lottery may have lost hundreds of thousands of dollars in revenue.

John L. Russell/Associated Press

Gerry Selbee’s gambling group has spent millions of dollars on the Cash WinFall game.

Lu’s group accounted for more than 80 percent of the sales and ultimately cashed in 860 of 983 winning tickets of $600 or more, part of a total estimated take of more than $2 million in prize money.

Lottery officials now insist they had no way of knowing until it was too late that Lu’s group was manipulating the game - that its computers could not predict what ultimately happened and no one had done it before. They also said they did not detect the bulk purchases of tickets by Lu.

They said they put “protocols’’ in place afterward to make sure it did not occur again.

But the game’s biggest player, Selbee, says the Lottery had ample advance notice that Lu was deliberately buying so many tickets that he would push the grand prize above $2 million and force the game’s rolldown. By Monday, the day of the drawing, the group had bought nearly $1.4 million in tickets.

“One would have to be brain-dead not to notice that the avalanche [in sales] had begun in the days leading up to the August 16th draw,’’ said Mohan Srivastava, a Canadian statistician who gained fame in gambling circles when he found a flaw in a Canadian instant game, allowing him to accurately pick winning tickets 90 percent of the time.

After the Globe reported in July that Selbee’s GS Investment Strategies and two other groups had all but taken over the game, Lottery officials took swift action, saying they had to protect the integrity of the lottery. They announced they were phasing out Cash WinFall and suspended two lottery agents who broke the rules by letting Selbee and his wife Marge operate ticket terminals. They punished several other agents who were printing out tickets for other groups when members were not present. They also imposed restrictions on the amount of tickets lottery agents could sell in a day, effectively ending the groups’ ability to dominate the game.

Now, Selbee says the lottery’s crackdown was an act and that officials have known since at least 2005 that big time gamblers were moving in - he told them himself. Far from being upset, Selbee said, lottery officials encouraged him to play big, even installing extra ticket machines at Selbee’s favored stores so that he could buy more tickets faster.

“They knew exactly what we were doing,’’ he said. “They were cooperating with this club and encouraging us to play. You reported that Billy’s Beverage sold nothing one day and all of a sudden sold $114,000 the next day. Why were there two lottery machines there? It was only to accommodate us. We also had two extra printers under the counter instead of one. That was arranged by the lottery to accommodate our play.’’

Several lottery employees, he said, observed as he and Marge operated ticket machines at the tiny western Massachusetts stores where they bet - Billy’s Beverage in Sunderland and Jerry’s Place in South Deerfield.

In the spring of 2006, he said the Springfield regional manager came out to meet the Michigan couple as they cashed in mountains of winning tickets. “He personally wanted to shake our hand and thanked us for coming to Massachusetts and playing Cash WinFall,’’ recalled Selbee. “He told us that statewide sales were flat or down and we were the only reason his sales were up.’’

Lottery officials said then Springfield manager Dan Thibeault did not remember such a meeting.

So Selbee was surprised, to say the least, when the lottery essentially put his group out of business here, and punished the owners of Billy’s Beverage and Jerry’s Place by suspending their right to sell tickets for 26 days. Both Paul Mardas, the owner of Billy’s Beverage, and Jerry Dagrosa, the owner of Jerry’s Place, are officers of Selbee’s gambling company and take part in the betting. Lottery agents are permitted to play the lottery, officials said.

Mardas said he was stunned when the lottery took strong action against him. “This is part of my bottom line and part of the store’s general draw,’’ said Mardas. “It’s like if all of a sudden I couldn’t sell beer.’’

Lottery spokeswoman Beth Bresnahan defended the lottery’s response, adding that the agency “never asserted that the syndicate groups playing Cash WinFall were playing outside of the parameters of the game rules. “ But, she said, the lottery will not tolerate sales agents’ breaking the rules.

She said Billy’s Beverage and Jerry’s Place received extra equipment because their “level of sales’’ warranted them, and said she had “no information’’ that lottery staff actually taught the Selbees how to operate the machines.

Selbee said the lottery also should have understood that for smart bettors like Yuran Lu, and himself, plundering Cash WinFall would be relatively easy.

All you needed was access to enough cash to quietly push the jackpot to $2 million earlier than the lottery was predicting - which is exactly what Lu’s group did Aug. 16.

Selbee said he could have done the same thing but believed it was unfair to the other players, who would miss the chance to jump in when the prizes were most valuable.

Lu has a documented history of high-tech pranks. A 2007 MIT graduate with majors in electrical engineering, computer science and math, Lu was an especially clever student - described by the school’s daily newspaper, The Tech, as having a “distinguished academic record even by MIT standards.’’ But he also gained a reputation as an accomplished hacker.

He once collected hundreds of passwords to MIT’s computer system and sent them to the administration to show how easy it was, the paper reported. He also broke into the Chinese Student Club’s website, replacing it with a “Hacked by Chinese’’ version. He at first agreed to be interviewed about Cash WinFall, but later did not return phone calls.

According to lottery officials, Yu appeared at headquarters in 2005 saying he was working on a statistics paper and wanted information about the game. Officials believe he was among the first to place large wagers on Cash WinFall.

During a four-day stretch between Aug. 13 and Aug. 16, 2010, Lu and his MIT classmate James Harvey, who also did not return phone calls from the Globe, bought nearly $1.4 million in tickets.

When the jackpot exceeded $2 million Aug. 16 and no one won, the rolldown automatically began. Lu’s group cashed in winning tickets of between $2.3 and $2.5 million, by experts’ estimates. (The lottery keeps records of only prizes cashed worth $600 or more.)

The lottery’s failure to see the rolldown coming meant the general public did not increase their play in response to it, and cities and towns - the recipients of the state’s lottery proceeds - lost revenue. Bresnahan said the lottery computers use a formula based on historical sales data to predict when the jackpot will be hit, and that that formula could not take account of Lu’s sudden buying spree.

And because so few players bet, the payouts Aug. 16 - which included a prize of $30,282 for picking five numbers accurately - were the highest since 2008.

After the August rolldown caught him off guard, Selbee - whose 32-member group includes five lawyers, a certified public accountant and a bank vice president - wanted to make sure it didn’t happen again.

In December 2010, just before Christmas, he suspected someone might try to manipulate the game again as the jackpot grew closer to the $2 million trigger.

Midday on Christmas Eve, Mardas called Lottery headquarters in Braintree to see whether anyone had started buying tickets in bulk. When he was told big blocs of tickets were being sold, the Michigan group jumped in, but had already lost a few hours of buying time. Had they known the rolldown was imminent, the machines would have started spewing tickets just after dawn.

At 3 a.m. Christmas morning, the lottery announced that the next jackpot would hit $2 million and could prompt a rolldown.

On Christmas Day, someone identifying himself as a member of one of the other gambling groups showed up at Jerry’s Place, looking for Selbee. He suggested that if the groups coordinated their playing, it could be “mutually beneficial to both of us.’’ Selbee said he turned him away.

“It’s not illegal, but take a look at the effect of it,’’ Selbee said. “It’s unfair to all players, whether they’re big or small.

On Dec. 27, 2010, the jackpot hit $2.3 million. No one matched all six numbers and the rolldown occurred. The prizes were smaller because this time, everyone played.

Matthew Carroll of the Globe Staff contributed to this report. Andrea Estes can be reached at estes@globe.com.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.