US lawmakers hammered out a historic overhaul of financial regulations as dawn broke over the nation's capital on Friday, handing President Barack Obama a major domestic policy victory on the eve of a global summit devoted to financial reform. In a marathon session of more than 21 hours, congressional negotiators agreed to a rewrite of Wall Street rules that may crimp the industry's profits and subject it to tougher oversight and tighter restrictions. The bill, the most sweeping financial rules revamp since the 1930s, is headed toward final congressional approval next week although implementation will be bogged down for months in regulatory rule-making. The legislation would set up a new financial consumer watchdog, create a protocol for dismantling troubled financial firms and mandate higher bank capital standards, all in an effort to avoid a repeat of the 2007-2009 credit crisis that hammered the economy and triggered taxpayer bailouts of floundering firms. To secure agreement, lawmakers reached deals in the final hours on the most controversial sections, which restrict derivatives dealing by banks and curb their proprietary trading to shield taxpayer-backed deposits from more risky activities. Banks will be allowed to keep most swaps dealing activity in-house, although the riskiest trading would be pushed out into an affiliate. They will also be permitted small investments in hedge funds and private equity funds. The concessions could lessen the impact on bank profits. The KBW bank stock index, which registered its worst performance since October last month, closed up 2.9 percent, with Goldman Sachs Group Inc and Morgan Stanley, two of the banks that will be most affected, helping lead the way. The reforms must still win final approval from both chambers of Congress before Obama can sign them into law. Quick approval is expected. Democrats had raced to complete their work before Obama left for a weekend meeting of the Group of 20 economic powers, where he can tout the changes as a blueprint for other countries. “Just as economic turmoil in one place can quickly spread to another, safeguards in each of our nations can help protect all nations,” Obama said at the White House shortly before departing. As part of the package, financial institutions would have to pay $19 billion to cover the estimated cost of the bill. The House of Representatives could vote as soon as Tuesday, and Senate action is expected to swiftly follow. The compromise allows banks to stay involved in foreign-exchange and interest-rate swaps dealing, which account for the bulk of the $615 trillion over-the-counter derivatives market. They also could participate in gold and silver swaps and derivatives designed to hedge banks' own risk. But they would need to spin off dealing operations that handle agricultural, energy and metal swaps, equity swaps and uncleared credit default swaps.