LISBON, Portugal (AP) -- Three times over the past year, the 13 judges of Portugal's Constitutional Court have solemnly filed into a tall-ceilinged room in Lisbon's 19th-century Palacio Ratton and slammed the brakes on key steps in the country's attempts to overhaul its economy.
Dressed in full-length black robes, the judges ruled that the government's plans to cut spending by more than 3 billion euros ($4 billion) were unconstitutional because they would infringe on workers' rights, including equality and job security.
Since coming to power two years ago, the government hasn't won a single economic argument with the court and has had to scramble to make up the budget shortfall, largely through higher taxes. Those increases have cost many people the equivalent of more than a month's pay this year.
The rulings have tried the patience of Prime Minister Pedro Passos Coelho, who is desperately trying to conclude Portugal's three-year bailout program. He has urged the judges to show "more common sense" and take into account the country's economic plight. Portuguese government attorneys are now scouring law books, looking for a way through the constitutional minefield.
The repeated rebuffs highlight some of the difficulties encountered by debt-heavy southern European governments as they attempt to jettison costly entitlements and safeguards that were adopted last century.
For Portugal, which needed a 78 billion euros ($103 billion) rescue in 2011, the problem is becoming acute. Under the terms of the bailout agreement, it is supposed to get its finances back on a sustainable footing by the middle of next year. But that goal is increasingly in doubt as the center-right coalition government has missed deficit targets, and Portugal may need more help.
Though possessing one of the smallest economies among the 17 countries sharing the euro currency, its constitutional predicament could keep a fire under the bloc's debt crisis.
The country's unemployment rate stands at 16.5 percent, and the economy is expected to shrink 2.3 percent this year for a third straight year of recession. The government has fallen short of its initial budget deficit targets for the past two years.
The Portuguese Constitution was written almost 40 years ago following a 1974 military coup that ousted a dictatorship established by Antonio Salazar in the 1930s. After the so-called Carnation Revolution, the country lurched to the political left. Its new Constitution enshrined previously neglected workers' rights.
Since then, amendments have stripped the Constitution of its more radical features, such as the pursuit of a "classless society" and the "socialization of the means of production." But its preamble still speaks of "paving the way for a socialist society." And working for the government has for years been prized in Portugal, as it offers shorter working hours, is commonly a job for life, and still provides a better pension than in the private sector — thanks to the constitutional guarantees.
Portugal's bailout creditors — the country's fellow euro members, the European Central Bank and the International Monetary Fund — insist the government employs too many people and pay and pensions are too generous. Their demand for cuts in the payroll of some 574,000 staff is a key plank of the bailout program.
However, the Constitutional Court has repeatedly struck down government plans to reform and save money:
— Measures that would scrap last year's vacation and Christmas bonus for government workers and pensioners were ruled by the judges to violate the principle of equality as private-sector workers would still get their bonuses. The missed saving: 1.065 billion euros.
—Earlier this year, more pay cuts, including to bonuses and welfare payments, failed to make it past Palacio Ratton. Lost saving: 1.326 billion euros.
—The latest black eye for the government came in August, when the court ruled that a plan to retrain surplus government workers and then, if there is no place for them, lay them off was ruled unconstitutional. It violated guarantees of job security, the judges declared. Lost saving: almost 900 million euros.
Antonio Costa Pinto, a Lisbon University political scientist, said the central problem is that the government is trying to introduce retroactive reforms in the public administration, which break contractual promises.
"The government will come up with financial alternatives" to meet its spending targets, Costa Pinto said. "But the reforms will take longer" because they likely will have to apply only to new hires, he said.
Portugal is in a race against time. If it doesn't comply with the bailout agreement, the lenders would withhold disbursements of the rescue money. The next assessment by the lenders' inspectors begins next week, and their consent is needed for Lisbon to get its next check, worth 2.8 billion euros.
In place of the money-saving reforms the Constitutional Court rejected, the government could hike taxes again. But Passos Coelho has conceded such a move could further choke the economy. Also, with municipal elections due Sept. 29, the government is reluctant to make itself more unpopular.
Pressure is on the government lawyers to come up, speedily, with legal arguments that circumvent the judges' ruling.
More broadly, changes to the Constitution may prove necessary. But that requires a two-thirds majority of votes in Parliament, which the government doesn't have.
The government's discomfort is unlikely to end any time soon. Opposition parties and labor groups say they'll ask the Constitutional Court to rule on the lawfulness of other imminent measures. They include an increase in civil servants' working hours to 40 hours a week from 35, and an average 10 percent cut in the pensions of most government workers.
Passos Coelho has raised the alarm: any backsliding on promised reforms could leave Portugal needing a second bailout, under terms harsher than the first rescue.
He slammed the Constitutional Court judges for being "more protective of standing entitlements than of future generations."
"Has anyone thought to ask the more than 900,000 people who have no job what the constitution has done for them?," he added.