DUBLIN – The banking problems that wrecked Ireland’s public finances, prompting an international bailout, have been largely contained, and the economy is projected to expand this year for the first time since 2007.

But this tentative turnaround is now at risk from the rest of Europe, where an economic slowdown and political wrangling over how to address the continent’s debt crisis threaten to undermine Ireland’s hard work.

Economic analysts are holding up Ireland as a model of how countries in a banking crisis should tackle their financial firms — putting some out of business, injecting money into others, and moving with haste. The International Monetary Fund and the United States have urged that other countries in the euro currency zone adopt an equally thorough and aggressive approach.

So, too, the Irish government has moved swiftly to balance its books while others have tarried. Ireland is expected to meet targets for its budget deficit this year and next.

Ireland, however, also offers a cautionary tale for other victims of Europe’s debt crisis, illustrating how long it can take to recover and the hazards along the way.

The country’s success depends on the uncertain economic health of its European neighbors, which are crucial customers for Irish exports, and on the ability of other cash-strapped European countries to put their own finances in order.

Bad economic news from another country can be bad news for Ireland. Investors remain mistrustful of eurozone countries as a whole, threatening to confront Ireland with prohibitively high interest rates next year when it’s scheduled to begin borrowing again on international markets.

The IMF this week cut its growth projections for Ireland to reflect an expected decline in exports, especially to Europe and the United States. Moreover, the IMF said, the outlook for Ireland remains “clouded,” largely because of the “perceived lack of coordination at the wider euro area level.”

New economic problems in Ireland, in turn, could further undermine faith in the euro area. And British banks, which have large holdings in Ireland, could also take a hit, posing a threat to a variety of global financial companies that do business with them.

Ireland is being supported by a three-year, $123 billion emergency program put in place in December. Judged in isolation, the plans prepared by the IMF, the European Union and Irish authorities seem to be working.

The country’s core problem — banks strangled by bad loans when a real estate bubble burst — is being resolved, according to IMF and other studies. Financial firms that were too far gone — the Anglo Irish Bank, for example — were put out of business. The ones that remain have been restructured and given fresh injections of capital by the government.

The cost has been steep. Ireland’s blanket commitment to protect its banks threatened the government with insolvency and forced it to seek IMF and European help.

The follow-up process involved strict tests to see how much new capital the banks needed, and the creation of a publicly funded “bad asset” company to take the worst loans off their books. The four remaining major banks have been forced to set aside unusually large sums of money to protect against bad loans, develop plans to shrink by tens of billions of dollars in coming months, and return to the more conservative practice of relying mostly on savings deposits — rather than large loans from investors — as a source of credit for businesses and homeowners.

The United States and IMF have urged other European countries to give their banks similar medicine. Banks elsewhere on the continent have been reluctant to write off bad debts, put bankrupt companies out of business, raise new capital and confront possible losses on government bonds.

Ireland was “spiritually closer to the U.S. and U.K. model of speed and transparency” in tackling its bank problems, said Jonathan McMahon, director of credit institutions supervision for the Central Bank of Ireland. McMahon said the Irish assumed that any partial effort to fix the banks would fail to win the confidence of global investors. A weak program, he said, would be a “disaster.”

Public sector payrolls, meantime, were trimmed with salary cuts and hiring limits, and the retirement age was increased.

Ireland has also benefited as its labor force has become more competitive, the result of wages remaining stagnant.

And a strong export sector, including major international pharmaceutical and technology companies lured by the country’s low tax rate, took advantage of recent growth in Asia and the slight recovery in the United States and Europe. Foreign investment is up sharply.