BRUSSELS — European leaders agreed on Monday to provide a huge rescue package of nearly $1 trillion in a sweeping effort to combat the debt crisis that has engulfed Europe and threatened markets around the world.

In an extraordinary session that lasted into the early morning hours, finance ministers from the European Union agreed on a deal that would provide $560 billion in new loans and $76 billion under an existing lending program. Elena Salgado, the Spanish finance minister, who announced the deal, also said the International Monetary Fund was prepared to give up to $321 billion separately.

Officials are hoping the size of the program — a total of $957 billion — will signal a “shock and awe” commitment that will be viewed in the same vein as the $700 billion package the United States government provided to help its own ailing financial institutions in 2008.

The package was much higher than expected, and represented an audacious step for a bloc that had been criticized for acting tentatively, and without unity, in the face of a mounting crisis.