IN HIS six years in office Barack Obama has rarely had occasion to thank Republican legislators for their support. Global trade rules may give him a reason to do so. In 2013 the Obama administration began a serious push for to complete bold trade deals: two grand regional deals, with Europe and with Pacific rim economies, as well as a handful of global agreements. Negotiations on the deals have not gone as smoothly as initially hoped. A Pacific deal—the Trans-Pacific Partnership (TPP)—was supposed to be done by now. A global deal agreed under the umbrella of the World Trade Organisation in late 2013 nearly fell apart last year over Indian demands for special treatment. Yet the biggest threat to the most ambitious deals—the TPP and its European cousin, the Trans-Atlantic Trade and Investment Partnership (TTIP)—has been the risk that America's Congress will not grant Mr Obama Trade Promotion Authority (TPA), or "fast track". Fast track guarantees a deal an up-or-down vote in Washington with no amendments. That gives the president the ability to make credible promises in negotiations which cannot be amended away later by a meddling Congress. Fast track expired in 2007 and Congress has not rushed to renew it.

That may soon change. Yesterday key legislators worked out a deal for a bill to give Mr Obama TPA. The bill has a hard road ahead; it must be approved by both houses of Congress and will need Democratic votes in the Senate to pass. That is anything but assured; many of the president's loudest critics on trade are within his own party. The deal is nonetheless heartening news, given the stasis into which negotations on the president's proposed trade deals seemed to have fallen.

Those deals would not be any minor step forward for trade. TPP—which would almost certainly be the first big deal to benefit from fast track—is an ambitious, "next generation" trade agreement that, if sealed, would link many of the large economies of the Pacific rim: including America and Japan, Australia and Canada, Chile and Mexico—though notably not China. The potential members combine to produce around 40% of global GDP and one-third of world trade. Yet the TPP is designed to boost trade where it currently lags: in services, which account for most of rich countries’ GDP but only a small share of trade. Opening up trade in services could help reduce the cost of everything from shipping to banking, education and health care.

Perhaps just as important, if the countries of the TTIP and the TPP agree on standards for components of services trade (by agreeing to mutual recognition of certain regulatory approval processes, in medical services, for instance) those rules could effectively function as global standards, given the large share of world GDP adhering to them. That, in turn, would deny the large and growing Chinese economy the opportunity to establish its preferred rules as the global benchmark.

The TPP has plenty of obstacles to overcome. However next-generation it is intended to be, negotiations have bogged down over agricultural disagreements between America and Japan (the duty on imported "polished" rice is 777.7%). Yet negotiators have said for months that they are in the last mile. Time is not on their side, however. Delay has allowed opposition in both America and Japan to mobilise. Whether the congressional compromise has come soon enough remains to be seen.

That compromise is aimed at defusing some of the main talking points deployed against the deal. Its detractors cite the typical concerns with such agreements: that a job-destroying flood of cheap imports is inevitable. They also worry that TPP's next-generation aspects boil down to an outsourcing of American regulatory authority to foreign governments, many of which will care far less about environmental and labour issues than Americans (particularly those that vote for Democrats). Opponents have also argued that TPP represents little more than a giveaway to large corporations; its intellectual-property measures, in particular, have been subject to scrutiny (in part because portions of the relevant sections of the deal have been made public by Wikileaks). Some critics say the deal's language looks as though it were written by Hollywood lobbyists.

In an effort to reassure the sceptics, the bargain struck in Congress would make fast track conditional. If a long list of objectives, including some related to environmental and labour standards, is not met, then Congress will have the ability to "switch off" TPA and rewrite the agreement (in effect, killing it). The bill would also expand trade-adjustment assistance: a programme that provides aid to workers displaced by freer trade.

It is not clear that this will be enough to sway the Democrats needed for passage of the bill. Mr Obama is a lame duck, and leading Democrats are seeking to build a post-Obama identity. Populist opposition to trade could emerge as a central component of that identity. All eyes will be on Hillary Clinton, the presumptive Democrat presidential nominee, to see where she comes down on the measure.

One hopes the deal's supporters carry the day. On reasonable estimates TTIP and TPP could boost the world’s annual output by as much as $600 billion—equivalent to adding another Saudi Arabia. Some $200 billion of that would accrue to America. The deal would carry geopolitical benefits as well; China is quickly moving to build a global institutional infrastructure to rival America's. The deal in Congress is a step in the right direction, but the path ahead is fraught.