Like those running any gambling enterprise, officials at the Massachusetts State Lottery don’t like anyone muscling in on their turf. And when they think someone is, they can lower the boom on the interlopers with the best of them.

Court records indicate that in 2009 the Lottery became so alarmed about devices resembling slot machines popping up at convenience stores and other locations that it went on a major offensive. The Lottery informed its sales agents in no uncertain terms that it would terminate their licenses to sell Lottery products if they also placed the slot-like devices in their stores.

“The Lottery does not want to be in partnership with agents that engage in such business,” the state agency said in a late 2009 letter. “Therefore, this letter will serve as notice that pursuant to [state law governing Lottery licensing] the Lottery will terminate agents discovered to be using non-Lottery gaming or gaming-like devices.”

The devices targeted by the Lottery occupy a murky legal area. They sell a prepaid phone card for a dollar, but with the phone card comes the chance to play what is essentially a video slot machine, complete with spinning fruit and cash payoffs to winners. Other vendors operate Internet sweepstakes cafes, where patrons buy computer time along with the chance to play video games for cash prizes.

Distributors of the devices claim their machines are perfectly legal, offering sweepstakes promotions that are no different from those run by companies like Coca-Cola, Kellogg, Nestlé, and Sunkist.

King’s Prepaid Phone Cards, one of the major distributors of the phone card machines, is suing the Lottery, claiming the agency’s actions have wreaked havoc on its business, since most of its machines are placed with Lottery licensees. The Billerica–based company contends that in early 2009 the Lottery “began a campaign of threats, intimidation, and coercion designed to eliminate [King’s] from the marketplace.”

King’s says it had about 150 of the machines operating in about 100 locations in more than 70 cities and towns throughout Massachusetts, generating about $100,000 a month per machine in gross revenue. But in the wake of the Lottery’s crackdown, King’s says its business shriveled, plummeting to 12 mach­ines in five locations. The suit is still pending. All parties declined comment.

The Lottery isn’t the only one trying to block the spread of these machines. Cities and towns are also trying to shut them down or force them to seek licenses for their operations. Chelsea shut down one King’s operation last August for failing to have an entertainment license. In Boston, an eight-machine operation at Evelyn’s Place, an East Boston storefront completely dedicated to the devices, shut down abruptly in February after Boston Mayor Thomas Menino began raising concerns.

Menino, whose spokesman was contacted by Common­­Wealth for a comment about the Evelyn’s operation, responded by sending a letter to Attorney General Martha Coakley asking her to investigate. “I am concerned that such unregulated gambling activity will victimize seniors and other vulnerable residents,” Menino wrote.

An official from Coakley’s office declined to say whether the attorney general was involved in the shuttering of Evelyn’s. Lottery officials said they were not involved. The former owner of Evelyn’s could not be reached for comment.

Whether the devices are legal or not hinges on whether they are lotteries, which are illegal unless they are state-run. According to case law, a lottery requires three essential elements: a game of chance; payment of some consideration, such as money, to play the game of chance; and a prize. Remove any one of these elements and there is no lottery. Opera­tors of the slot-like devices say there is no payment to play the game of chance because the player is actually paying for a phone card or time on the Internet. Operators also say it’s possible to play without even buying a card.

The free-play option was the deciding factor in a 2007 Appeals Court lawsuit brought by South Dartmouth– based Nutel Communications, a competitor of King’s, that found machines in Fall River were legal because investigators failed to show that players could not play for free.

On a visit to Evelyn’s one morning in early February before it shut down, the place was bustling with activity. It was obvious players were focused on winning cash prizes and not the phone cards. There was also no free-play option, according to the attendant.

One of the players, a senior citizen, whispered that she had lost $300 playing the machine that day. “Like Fox­woods, you can’t beat the machines,” she said. “It’s an addiction.”