European creditors agreed to rescue Greece from the brink of financial ruin early Monday, after the Greek government capitulated to the most onerous terms yet as the steep price for remaining in the 19-nation eurozone.

The complex agreement, reached after 17 hours of negotiations, requires Greece to quickly adopt dramatic pension cuts and tax increases, and plan to sell off virtually all of its assets to help reduce its enormous debts. It also offers no debt relief that Greece had hoped to receive.

The new loans would total up to $95 billion over three years and come on top of a record $240 billion the country already has received since 2010. Many details of the pact still must be ironed out and ratified by political leaders in Greece and European lender nations, such as Germany.

European Council President Donald Tusk said the deal was “unanimously reached” by all 19 countries that use the euro currency. Yet that unanimous vote masked bitter divisions during the marathon talks.