The United States is set to pass narrowly on Tuesday its toughest measures yet to curtail speculation in commodity markets, likely shifting the focus of a fierce four-year debate from the regulators to the courts.

In a measure decried by Wall Street and trading companies as a misguided political attempt to cap soaring oil and grain prices, the Commodity Futures Trading Commission was poised to approve position limits that will cap the number of futures and swaps contracts that any single speculator can hold.

The divisiveness of the rule, set for a formal vote at the end of Tuesday's meeting, was stark from the opening. Key swing vote Michael Dunn, a Democrat whose term has already expired, said he would follow the Dodd-Frank law to set the limits while blasting them as a distraction from bigger issues.

Position limits are a sideshow, said Dunn, who is serving past his term until Congress confirms his successor. He said markets may become more risky, and hedging practices more difficult, possibly leading to higher prices.

I think it's important to let the public know what may happen once we implement position limits. ... In all likelihood prices of heating oil and gasoline will not drop ... Things will remain relatively the same, except for those that use the markets we regulate to provide resources we all need.

The commission is deeply split and a lawsuit to stop the measure seems ever more likely, one more hurdle for CFTC Chairman Gary Gensler, who is struggling against emboldened Republicans and a hostile Wall Street to put in place the rules required by the Dodd-Frank financial reforms.

After an eight-month battle, the Securities and Exchange Commission in July had its first Dodd-Frank rule overturned when a federal appeals court found the SEC had conducted a flawed analysis to support a rule that would make it easier for shareholders to nominate directors to corporate boards.

The position-limits rule may be challenged on similar grounds -- that the costs outweigh the benefits of a plan that many industry officials say will make markets riskier by driving trade to less-regulated overseas venues.

We need to be very careful, but I believe we're on very solid legal ground, Democratic Commissioner Bart Chilton told Reuters Insider on Tuesday.

It was not immediately clear who might bring a lawsuit, but the limits will affect dozens of major commodity traders and exchanges. Normally there is a limited period of two or three months after a rule is published in which a suit can be filed, though some of the rules will not take effect until late 2012.

Gensler will also need to encourage overseas regulators to keep up with the CFTC to prevent the regulatory arbitrage that many fear may ensue. A meeting of global regulators in London on Friday to discuss high-frequency trading will offer him a chance to encourage others to prevent loopholes.

But it's an uphill battle. Over the weekend, France failed to force mandatory curbs on energy and food commodities, and Britain's Financial Services Authority -- which oversees most of the major non-U.S. commodity exchanges -- has maintained a staunch opposition to mandated limits.

SOME RELIEF

The rule offers some cause for relief in the industry, relenting on several key provisions that were heavily criticized, as Reuters reported last month.

Those included tough measures on whether separately controlled accounts must be aggregated and whether swaps and futures positions can be offset, so-called class limits, the CFTC said. It also partly yielded to CME Group calls for equal treatment of cash and physical contracts.

But giving ground on those details will do little to temper frustration over a plan that could force banks such as Morgan Stanley and traders including grains giant Cargill to scale back business, stemming an influx of investor capital.

The CFTC estimated the measure would cost the industry $100 million in the first year.

The limits could temper investors who have poured over $300 billion into commodity markets, often via index swaps with banks. Under the new rules, banks will no longer be given an exemption for such speculative swaps, although they will be able to hedge on behalf of corporate customers.

Gensler should have the votes of Dunn and Chilton, the two Democrats on the commission. He faces opposition from Republicans Jill Sommers and Scott O'Malia.

O'Malia said the CFTC had failed to provide the empirical evidence to substantiate the rule -- an argument similar to that put forth by industry officials who say there is no proof of the link between speculators and commodity prices.

Dozens of academic, government and bank studies on the subject have differed on whether speculators influence prices long-term or whether prices simply respond to market conditions. The CFTC's own economists have yet to produce any economic evidence to connect speculators to price spikes.

Some politicians, however, have clamored for the CFTC to clamp down since early 2008, as oil and grain prices were shooting toward historic peaks.

DEVIL IN DETAILS

The rule covers 28 commodities from coffee to crude to copper, including nine crop markets that were already subject to limits, using a predetermined formula based on deliverable physical supply or open interest in the market. It includes for the first time contracts in the $600 trillion swaps market.

All the rules will be phased in over time, with the final limits for all contract months set only after the agency has collected a year's worth of swaps data, a process likely to be finished only late into 2012, officials said.

Several key provisions were eliminated from the CFTC's original proposal in January, as Reuters reported.

One key change relaxed the requirement that big commodity players aggregate all the positions held by any hedge funds or subsidiaries in which they have a stake. Instead, it retains the independent account controller regime currently in place, which views separately-run trading books independently.

Another eliminates a proposed conditional limits measure that would have allowed speculators in commodity markets that are settled in cash to accumulate positions of five times the limit for similar physical delivery contracts.

That rule had riled the CME Group, which feared losing business to rival cash-settled contracts, some of which are listed by the IntercontinentalExchange. The CFTC maintained this measure for the Henry Hub natural gas market, however, where cash contracts -- and in particular the ICE look-alike contract -- are already highly liquid.

Despite relenting on several elements that Wall Street had fought hardest, the new rule could ensnare a larger number of traders compared to the draft it released earlier this year.

Spot-month limits could affect 85 traders in the energy markets, more than double the January estimate, according to the CFTC's estimates. However, those estimates included companies that would qualify for hedging exemptions, leaving an open question as to how many speculators would be affected.

(Additional reporting by Sarah N. Lynch; Editing by Jonathan Leff and Dale Hudson)