TOPEKA — The Kansas Senate plodded through four hours of debate Friday before narrowly blocking a bill lowering the state's share of gambling revenue at dog and horse racetracks to make opening shuttered facilities in Sedgwick, Wyandotte and Crawford counties more attractive to investors.

Senators voted 17-20 against the bill after defeating an amendment that would have enabled Kansas Lottery retailers to engage in sports wagering if the U.S. Supreme Court ruled state-by-state prohibitions to be unconstitutional.

The bill before the GOP-dominated Senate would have reformed a 2007 state law by dropping from 40 percent to 22 percent the portion of slot-machine revenue transferred to the state. The adjustment would make the state's share of gambling revenue from racetracks correspond with the 22 percent required of each state-owned casino in Sumner, Ford, Crawford and Wyandotte counties.

In the past decade, the maximum number of state-approved casinos permitted under Kansas law — four — are in business. None of the racetracks eligible for slot machines have opened.

"It creates the opportunity to, what I like to call, right the wrong. The wrong was when the Legislature raised the tax share from 22 percent to 40 percent. Under the bill, they would be the same at 22 percent," said Sen. Bruce Givens, R-El Dorado.

Billionaire businessman Phil Ruffin, owner of Wichita Greyhound Park near Park City, the Woodlands in Kansas City, Kan., and Camptown Greyhound in Frontenac, had sought the change for years to improve viability of "racinos." He argued the existing requirement of 40 percent would render racetrack slow facilities unprofitable.

The bill offered Sedgwick County residents an opportunity to reconsider a vote rejecting slots at tracks. Senate President Susan Wagle, R-Wichita, predicted the county's voters would now support gambling at racetracks because "this is good economic development for the state."

In addition, the bill required racetracks in Kansas to offer a specific number of live races of horses or dogs to be eligible for slots in those locations. If 60 days of live racing occurred annually, these Kansas tracks would be able to offer simulcast gambling on races elsewhere in the country.

Senate Bill 427 invited the attorney general to request the Kansas Supreme Court rule on legality of the proposed reform of state gambling law.

Legislative critics pointed to a 2016 legal opinion from Attorney General Derek Schmidt indicating amendment of the state's gambling law would violate contracts between the Kansas Lottery and casino operators. Testimony presented to House and Senate committees indicated the casinos would likely demand payment of $130 million in fees paid and interest accrued.

"There is a breach of contract. There's no question those contracts were meant to be punitive," said Sen. Ty Masterson, an Andover Republican voting against the bill. "It's almost like we have a masochistic desire for protracted litigation. I don't understand what we're doing."

Opponents of the gambling legislation also said managers of the four state-sanctioned casinos could file lawsuits to recover loss of market share resulting from recasting the rate assessed on slots at horse and dog tracks in Kansas. 

If a court ordered the state to pay the fees and interest, the bill would enable racetrack operators, such as Ruffin, to submit a letter of credit to repay casinos. Racetrack operators obligated by letters of credit would be repaid by claiming half the state's 22 percent of racetrack revenue.

The Senate bill would have lowered the privilege fee paid the state by racetrack operators from $3,750 for each slot machine to $2,500 for each machine. The legislation trimmed the minimum number of slots at each racing venue from 600 to 400. A maximum number of racetrack slots statewide would be set at 2,800.

Supporters of the racetrack gambling viewed the bill as an opportunity to generate as many as 4,000 jobs and strengthen the horse and dog industries in Kansas.

"It will revive an industry that really needs our help," said Senate Minority Leader Anthony Hensley, D-Topeka. "We need to give the racetracks a second chance."

Sen. Jeff Longbine, R-Emporia, voted "no" after expressing concern the bill lacked a requirement horse racing would return at the Woodlands.

"Can we force these facilities to open? We're a government, but not that kind of government," said Sen. Steve Fitzgerald, R-Leavenworth. "We ought to get out of the way and let the free market work."

Sen. Vicki Schmidt, a Topeka Republican, objected to the bill because implementation could undermine state casinos that funneled $513 million to the state treasury and $70 million to local units of government. "Why would we want to risk that source of revenue?" she said.

The Senate tweaked the bill to include an amendment offered by Sen. Oletha Faust-Goudeau, D-Wichita, mandating that state regulators impose rules guarding the well-being of racing animals.