BRUSSELS — With Spain’s borrowing costs climbing again to critical levels, European finance ministers decided early Tuesday to speed up their promised bailout for the country’s troubled banks, while also giving the cash-tight government more time to rein in its budget deficit.

After nine hours of debate, ministers from the 17 euro zone nations reached a tentative agreement on the bailout terms, including a “first disbursement” of 30 billion euros, or $37 billion, by the end of the month, Jean-Claude Juncker, president of the Eurogroup of finance ministers, said at a news conference.

That amount is “to be mobilized as a contingency in case of urgent needs in the Spanish banking sector,” he said. Additional payments — up to 100 billion euros was pledged last month — would most likely follow in the fall, after a more thorough review of the sector’s problems, he said.

At the same time, Spain’s targets for cutting its gaping budget deficit will be eased as the country sinks deeper into its second recession in three years, with an unemployment rate of almost 25 percent. But the ministers demanded that Spain squeeze its austerity budget even tighter to meet the new targets.