Spain set itself a softer deficit target for 2012 than originally agreed under the euro zone's austerity drive, putting a question mark over the credibility of the European Union's new fiscal pact.

Prime Minister Mariano Rajoy insisted he was acting within EU guidelines with the more lenient figure because it would still hit the European Union public deficit goal of 3 percent of gross domestic product (GDP) in 2013.

Spain's new 2012 target of 5.8 percent of GDP, was more realistic than the original goal of 4.4 percent but still demanding, he said.

I'm backing austerity and aim to reduce the deficit from 8.5 percent to 5.8 percent; that's significant austerity, he said at the end of an EU summit in Brussels on Friday.

The announcement cast a pall over an agreement for tougher debt rules in the bloc. All but two of the EU's 27 leaders signed up to a 'fiscal compact' on Friday that commits euro zone countries to balancing their budgets over the medium-term.

Spain has already cut spending sharply and adopted economic reforms to avoid getting sucked deeper into the euro zone debt crisis that has prompted bailouts for Greece, Ireland and Portugal.

German Chancellor Angela Merkel and European Council President Herman Van Rompuy said that for euro zone credibility to endure there should not be any flexibility on fiscal targets for countries in economic difficulties.

Rajoy said his move would not spook markets, but Spain's long-term cost of borrowing rose after the news, bringing it to parity with Italy for the first time since August, as investors fretted Madrid may have to sell more debt than planned.

TEST CASE

Spain is emerging as a test case of whether Europe is willing to ease fiscal rules that heap more cuts on member states grappling with stunted growth, high unemployment and the threat of growing social unrest.

The government said on Friday that Spain's economy will shrink 1.7 percent this year, matching the outlook from the International Monetary Fund.

Rajoy's announcement made economic sense for Spain but Madrid and Brussels should have been able to negotiate a way out of the clash, said Thomas Klau, head of the European Council on Foreign Relations in Paris.

It's the first step for undermining the credibility of a system which has not even had time to accumulate any credibility capital, Klau said, referring to the fiscal pact.

Rajoy said he did not bother lobbying other European leaders at Friday's summit.

I'm not going to tell the other presidents or heads of state about the deficit figure that will be included in our budget. I don't have to. It's a sovereign decision. I'll tell the (European) Commission in April, Rajoy said.

The gambit will force the EU to decide whether or not to punish Spain under new austerity rules.

It's a dangerous game because you jeopardize the legitimacy of the whole (fiscal stability) process, said Antonio Barroso, a London-based political analyst with the Eurasia Group. Either he knows eventually they will make the objectives more flexible, or he's very brave and prefers to get the sanction.

Rajoy, known as a cautious public administrator, campaigned on strict adherence to the 4.4 percent target in an election campaign which ended with an overwhelming majority for his centre-right party in November.

But Spain's economic situation has deteriorated since then.

POTENTIAL UNREST

Recent cuts to spending in education and health have led to tens of thousands of students taking to the streets across the country with a heavy-handed police response provoking widespread anger amongst Spaniards.

Madrid said on Friday it would make around 15 billion euros more in fiscal adjustments in 2012, adding to around 15 billion euros of spending cuts and tax rises announced in December. It cut its spending ceiling by nearly 5 percent from 2011 to 118.6 billion euros.

Getting the deficit down to the 4.4 percent target from the 2011 8.5 percent would have entailed around 44 billion euros in total cuts, plunging the country deeper into recession and likely provoking Greek-style riots.

European Commissioner for Economic and Monetary Affairs Olli Rehn has insisted Spain provide more details of why its deficit for 2011 overshot by such a wide margin. The target had been 6 percent.

Sources have told Reuters that some at the European Commission suspect Madrid inflated its deficit forecasts for 2011 to help it gain flexibility for its target this year. The Spanish government has vigorously defended its figure.

Credit ratings agency Fitch backed Spain's push for a more lenient deficit objective for this year, while still aiming to hit the 3 percent target set for 2013. The agency said it would not hurt the country's ratings to have a realistic target.

Bleak jobless figures showed the pressure Spain's economy is under as it struggles to restart growth while fighting the highest unemployment rate of developed countries.

Total unemployment rose to 4.7 million in February, meaning Spain accounts for nearly one third of all those without work in the European Union.

($1 = 0.7501 euros)

(Additional reporting by Carlos Ruano; Writing by Nigel Davies; Editing by Fiona Ortiz and Mike Peacock)