After nine hours of emergency talks in Brussels, the ministers said the money would be available by the end of July.
It was also agreed that a 2013 deadline for Spain to cut its budget deficit to the EU limit of 3% could be extended by one year.
There have been fears that Spain's troubled banks could lead the country to ask for a full state bailout.
Eurozone countries agreed in June to lend up to 100bn euros ($125bn; £80bn) to support Spain's banks.
The yield on Spanish bonds rose sharply on Monday ahead of the meeting, with many fearing that little concrete action on Spanish banks would be reached.
"We are aiming at reaching a formal agreement in the second half of July, taking into account national parliamentary procedures, allowing for a first disbursement of 30bn euros by the end of the month to be mobilised as a contingency in case of urgent needs in the Spanish banking sector," Eurogroup President Jean-Claude Juncker said.
"There will be specific conditions for specific banks, and the supervision of the financial sector overall will be strengthened," he added.
"We are convinced that this conditionality will succeed in addressing the remaining weakness in the Spanish banking sector."
On Saturday, Spanish Prime Minister Mariano Rajoy announced that he would take further steps soon to cut the country's public deficit.
In a news conference at the end of Monday's marathon meeting a number of appointments were also announced.
The ministers reappointed Mr Juncker as their chairman and picked German Klaus Regling to head the permanent bailout fund, the European Stability Mechanism, due to come into force this month.
The finance ministers' conclusions will be submitted to a meeting of all 27 EU finance ministers later on Tuesday.
Earlier on Monday, the yield on Spanish 10-year bonds - which are taken as a strong indicator of the interest rate the government would have to pay to borrow money - rose above 7%, while Italian bond yields rose to 6.1%.
Yields above 7% are considered to be unsustainable in the long term.
Among the key agreements from the 29 June summit were moves towards a banking union with the European Central Bank (ECB) acting as a supervisor and allowing European bailout funds to buy bonds to try to reduce countries' borrowing costs.
But since the summit, there have been signs that Finland and the Netherlands would oppose the use of bailout funds in this way.
Regarding www.skoptionstrading.com. We recently closed a trade involving the S&P which generated a profit of 25.61% and was opened just 8 days ago, the charts and stats have now been updated.
Our trading success rate is 91.00%
91 profitable trades out of 100.
Our model portfolio is up 455.14% since inception
An annualized return of 81.15%
Our annual performance figures are as follows:
2009 We made a profit of 23.89%
2010 We made a profit of 158.66%
2011 We made a profit of 40.95%
In 2011 we outperformed:
S&P by 42%
HUI by 53%
Gold by 31%
Silver by 41%
The 2011 Annual Report by be accessed via this link.
Also many thanks to those of you who have already joined us and for the very kind words that you sent us regarding the service so far, we hope that we can continue to put a smile on your faces.
To stay updated on our market commentary, which gold stocks we are buying and why, please subscribe to The Gold Prices Newsletter, completely FREE of charge. Simply click here and enter your email address. Winners of the GoldDrivers Stock Picking Competition 2007
For those readers who are also interested in the silver bull market that is currently unfolding, you may want to subscribe to our Free Silver Prices Newsletter.
For those readers who are also interested in the nuclear power sector you may want to subscribe to our Free Uranium Stocks Newsletter, just click here.