By Liz Alderman, New York Times

ATHENS — The verdict set crowds of police officers cheering.

Greece’s top administrative court declared in mid-January that wage cuts imposed two years ago on police officers, firefighters and military personnel under a sweeping austerity plan were unconstitutional.

Welcome as it was to the employees, the news could not have come at a worse time for Prime Minister Antonis Samaras. After years of sacrifice by Greeks, he was preparing to announce last week that his country had scored a rare victory in its long-running economic crisis, posting its first primary surplus — a budget in the black, before debt repayments — in more than a decade.

The back pay by itself is not a big number. The government might be forced to repay up to 300 million euros, or about $405 million.

But it could blow a hole in Mr. Samaras’s projected surplus, which itself is only about 1 billion euros ($1.35 billion). The repayment is a reminder of the continued fragility of Greece’s public finances — and Mr. Samaras’s continuing challenge of trying to appease the populace while also struggling to please the country’s international creditors.

Not only is his coalition government under pressure domestically, but he has been hoping that Greece’s fiscal discipline might persuade its international lenders to ease the burden of the €240 billion ($324 billion) in bailout loans that it is obliged to pay back.

Without some sort of relief, that mountain of debt will make it difficult for Greece to lift itself from its five-year recession or to reduce its disastrously high unemployment rate.

“The narrative in Greece is that the economy is improving: For the first time, it is hitting a primary surplus; its fiscal numbers look good, and there’s a clear turnaround in economic sentiment,” said Mujtaba Rahman, the Europe director of the Eurasia Group in London. “But the challenges are far from over.”

Mr. Samaras’s announcement of a primary surplus was supposed to represent a turning point. Under the conditions set by Greece’s so-called troika of lenders — the International Monetary Fund, the European Central Bank and the European Commission — the country is allowed to spend a portion of the surplus on anything it deems necessary.

The target would most likely be programs to assuage austerity-weary voters. It is something Mr. Samaras is eager to do ahead of pivotal local and European parliamentary elections in May, when his government will face a stiff challenge at both levels from Syriza, the anti-bailout opposition party.

May is also when Greece must make an €11 billion payment on its international debt.

Well before then, Mr. Samaras will need to figure out his response to the high court’s ruling. The government may need to recalculate its €1 billion surplus or find other means to finance the back pay to public safety and military personnel, said Jens Bastian, an economic consultant who served for two years on the European Commission’s task force for Greece in Athens before stepping down in December.

The liabilities could grow even higher, as other elements of Greece’s austerity program face legal challenges. Last week, the same court concluded that a tax on benefits to university staff was illegal. Pending cases are questioning whether wage cuts imposed by the troika violated the Constitution.

While some of the recent improvement in Greece’s coffers was achieved through sharp spending cuts, much of it came from higher taxes, including an increase in the value-added tax, a new property tax and a rise in business taxes.

Those levies may prove hard to maintain. Companies continue to collapse amid the recession. The amount of tax that property owners will pay this year is expected to reach €3.5 billion, a sevenfold increase from 2009.

While tax evasion has long been a problem in Greece, even citizens who have been willing to pay their share now say they are being squeezed. “Many people are having a hard time now, even higher earners,” said Mr. Bastian, the consultant. “They are not saying, ‘We won’t pay.’ They say, ‘We can’t pay.' ”

A recent report by the Parliamentary Budget Office in Greece said taxpayers’ capacity was being exhausted, putting the goals of a steady primary surplus in doubt. Business leaders sound a similar warning. “The tax burden is killing the economy,” said Evangelos Mytilineos, the chairman of Mytilineos Holdings, one of Greece’s largest industrial conglomerates.

“But the troika and the government says Greece’s only advantage is our fiscal surplus, so at the moment the directive is to achieve that no matter what,” Mr. Mytilineos said. “It’s the only thing we can use to say to Germany: ‘We are putting our house in order.' ”

The primary surplus, after all, is simply an accounting target. But Greece’s underlying debt burden is growing larger — climbing to an estimated 174 percent of its economic output last year. That was up from 130 percent four years earlier, and is the second-highest in the world, after Japan’s. But Japan’s global creditworthiness enables it to shoulder that load.

Although the Greek government forecasts a tiny economic recovery this year, projecting growth of 0.6 percent, that would be nowhere near robust enough to make a dent in the debt.

Unemployment continues to climb. In October, the most recent month for which data is available, it hit a record 27.8 percent, with youth unemployment reaching 59.2 percent, according to Eurostat. As wages fall, consumer spending slumped more than 7 percent last year.

Small and midsize businesses continue to close as banks refrain from lending. While Greek banks have been recapitalized, around 30 percent of the loans in their portfolios are in or near default. The figure may rise as high as 40 percent this year, further crimping banks’ willingness to lend and removing credit that is needed to stimulate the economy.

“The dynamics are such that Greece is not on a path toward debt sustainability,” Mr. Bastian said. “Greece is nowhere near being able to grow itself out of debt.”

That has set the stage for a battle between Greece and its creditors. Part of the debt burden was eased two years ago at the height of the euro zone crisis, when the banks and hedge funds that held the bulk of Greece’s debt were forced to accept a 75 percent loss on their Greek bond holdings, the largest debt write-down in history.

But as public institutions extended emergency lifelines to the country, about 70 percent of the remaining debt is now held by foreign taxpayers in Germany and elsewhere, where governments are much less inclined to take a hit.

The I.M.F. broached the issue last year, saying that Greece would require additional debt relief. Even Germany’s finance minister, Wolfgang Schäuble, acknowledged after German elections in the autumn that some help would be needed.

But any hopes that those remarks may have raised in Athens have since been curbed, as other German officials have argued that Greece is already getting some relief through previous agreements that more than doubled the length of its loan paybacks, to an average of 30 years. Greece is pushing to extend some repayments out to 50 years.

Greece, the Germany says, is also receiving very low interest rates on its bailout loans. Any relief would effectively involve European taxpayers; governments including those in Germany, France and Spain are loath to tell electorates that they are liable for Greece’s debt.

“There will not be a debt haircut,” said Klaus Regling, the German official in charge of the euro zone’s bailout fund, the European Financial Stability Facility.

The debt load is hurting business. While foreign investors have started to come back to Greece, “the mountain of debt is putting the brakes on getting more foreign direct investment,” said Mr. Mytilineos, the Greek industrialist.

There have been signs that foreign investors, which as a category got burned by the Greek debt restructuring in 2012, have started to test the Aegean waters again.In October the Canadian investment fund Fairfax Holdings acquired a 5 percent stake in Mr. Mytilineos’s industrial group, and took a stake in the property developer Eurobank Properties.

York Capital Management in November invested €100 million in the Greek construction group GEK Terna. And the hedge fund billionaire John A. Paulson and American hedge funds have been investing in Greece’s struggling banking sector. But there may be limits to such inflow of capital, as long as Greece’s long-term prospects remain cloudy.

The currency depreciation across the globe also complicates Greece’s recovery. While countries like Turkey are struggling with plummeting values for their currency, those declines will eventually make their exports more competitive on the global market. Greece, however, remains attached to the euro, whose strength is pegged to stronger economies like Germany’s. That makes it harder for Greece to grow through exports.

“If you consider that Greece is in the monetary union and it can’t depreciate its currency, its other main options are to increase public infrastructure works, increase the supply of money or decrease taxes to kick-start the economy,” Mr. Mytilineos said.

“Greece has none of those options, so as long as we don’t get more foreign direct investment, the economy won’t get going,” he said. “Those who think growth will increase this year are optimistic. It will be a very slow process.”