WASHINGTON — Congressional leaders and the Bush administration reached a tentative agreement early Sunday on what may become the largest financial bailout in American history, authorizing the Treasury to purchase $700 billion in troubled debt from ailing firms in an extraordinary intervention to prevent widespread economic collapse.

Officials said that Congressional staff members would work through the night to finalize the language of the agreement and draft a bill, and that the bill would be brought to the House floor for a vote on Monday.

The bill includes pay limits for some executives whose firms seek help, aides said. And it requires the government to use its new role as owner of distressed mortgage-backed securities to make more aggressive efforts to prevent home foreclosures.

In some cases, the government would receive an equity stake in companies that seek aid, allowing taxpayers to profit should the rescue plan work and the private firms flourish in the months and years ahead.