INDIANAPOLIS — Indiana law allows someone to walk out of a convenience store and crack open a beer purchased there, but it can’t be a cold one.

Decades-old rules, closely guarded by elected officials who receive generous donations from the liquor store lobby, strictly manage who can sell “iced or cooled” beer for carryout.

It’s a right granted to package liquor stores and restaurants but denied gas stations and convenience stores — that is, until one gas station owner discovered a loophole. He installed seating and served burritos, landing a restaurant classification and the right to sell cold beer.

The maneuver has ignited a fierce legislative battle, with some of the state’s most powerful lawmakers scrambling to pass legislation to close the loophole, underscoring the liquor lobby’s clout.

“It’s crazy,” said Jay Ricker, who created the uproar by serving Mexican fare and securing the proper alcohol permits at two of his Ricker’s stores. “It points out the absurdity of the current regulations.”

Liquor stores say they are protecting what’s theirs, with store permits auctioning for as much as $500,000. But their influence extends beyond preserving cold beer rights. They played a major role in torpedoing a 2015 effort to repeal a Prohibition-era ban on Sunday alcohol sales, arguing it would unfairly benefit grocery stores.

An Associated Press review found liquor store interests have spent at least $150,000 on lobbying in recent years while donating more than $750,000 to lawmakers since 2010.

Owners of two of the state’s large liquor chains were poised to benefit financially from a stringent vaping industry law that lawmakers approved last year, records show. The law, it was later discovered, effectively created a monopoly for a handful of politically connected companies and sparked an FBI investigation.

“Our owners, many multigenerational, are active and engaged in their communities and have personal relationships with their neighbors who happen to be citizen legislators and community leaders,” the Indiana Association of Beverage Retailers said in a statement to the AP.

Most liquor store contributions went to a handful of key lawmakers, including Republican Sen. Ron Alting, who leads a committee overseeing alcohol matters, GOP House Speaker Brian Bosma and Republican Senate leader David Long. Since 2010, they have collectively received more than $226,000 from liquor store interests, records show.

“This isn’t about protecting any lobbying interest, although it’s being depicted that way,” said Bosma, who voiced concern that Ricker’s could also sell hard liquor with their restaurant permits. “This is about who makes decisions about how you sell a controlled substance.”

Jim James, who did not respond to a request for comment, is president of Indianapolis-based 21st Amendment liquor stores and has donated $16,000 to Alting in recent years. After trying unsuccessfully since 2011 to get the permit revoked of a competitor with a gourmet wine and cheese store, Alting took up James’ cause last month.

Alting made changes to a bill likely making it impossible for the store to renew its permit. The provision was later removed after an outpouring of opposition, but not before Alting singled-out the store, Grapevine Cottage, for using a comparatively inexpensive grocery store permit to sell wine.

“You want to get into business?” Alting said. “Go buy a package liquor store permit.”

When asked about liquor store owners’ influence on Monday, Alting said he “goofed” by including the provision and argued the perception that “these big powerful lobbyists from the package liquor store” have undue clout is incorrect.

Last summer, Alting was among a handful of lawmakers interviewed by the FBI in connection with an investigation of the state’s vaping law.

John McCullough, whose family owns Evansville’s Frontier Liquors and has donated more than $31,000 to lawmakers since 2010, owns another company that is among six approved to produce the nicotine-laced “e-liquid” sold in the state. He did not respond to a request for comment.