BRUSSELS—Eurozone finance ministers and the International Monetary Fund patched together a deal in the early hours of Wednesday that clears the way for fresh loans for Greece and sets out how the country could get debt relief in the future.

The ministers, who held an 11-hour meeting in Brussels, said Greece had done what was necessary to unlock the next slice of financial aid, concluding a review of its bailout that was delayed for months. The new payouts will save Greece from defaulting on big debt redemptions to the IMF...