The deal was reached after talks in Brussels between the ministers and the International Monetary Fund (IMF).
In return, Cyprus is being asked to trim its deficit, shrink its banking sector and increase taxes.
Cyprus' banks were badly exposed to Greece, which has itself been the recipient of two huge bailouts.
"The Eurogroup was able to reach a political agreement with the Cypriot authorities on the cornerstones of this agreement," Eurogroup head Jeroen Dijsselbloem said after almost 10 hours of the negotiations.
"The assistance is warranted to safeguard financial stability in Cyprus and the eurozone as a whole,'' he added.
IMF chief Christine Lagarde, who took part in the talks, said earlier: "We don't want a Band-Aid. We want something that lasts, that is durable and sustainable."
The deal also involves a levy on bank deposits intended to ensure investors contribute to the bailout.
People with less than 100,000 euros in Cypriot bank accounts will have to pay a one-time tax of 6.75%, while those with more will have to pay 9.9%. It is expected to raise 5.8bn euros in additional revenue.
A European Central Bank (ECB) official said the Cypriot authorities had already started to take action to ensure that the levy can be collected. Otherwise, there would be a likelihood of massive withdrawals to avoid it, our correspondent adds.
There has also been speculation that Russia could help finance the bailout by extending a 2.5bn-euro loan already made to Cyprus. Cypriot Finance Minister Michael Sarris will travel to Moscow for meetings on Monday, reports say.
There are a lot of Russian deposits in the Cypriot banking system, according to economists.
Jacob Funk Kirkegaard, of the US-based Peterson Institute for International Economics, said that was a potential problem for any bailout negotiations.
"There is a general political sentiment that it is not acceptable to be bailing out a country, and thereby putting European taxpayers' money at risk, to basically protect Russian depositors in Cypriot banks," he said.
The Cypriot economy accounts for barely 0.2% of the eurozone's overall output. But there is concern within the euro bloc that a default by Cyprus risks undermining the progress being made in Greece.
Cyprus is the fifth country to receive eurozone assistance since the bloc's financial crisis began to unfold in earnest nearly three years ago.
Source: BBC News