Standard & Poor's downgraded Greece and Portugal on Tuesday, citing risks that the countries' debts to a new European bailout fund would be repaid before bond investors, sending their borrowing costs sharply higher.

The downgrades left Portugal one notch above junk and Greece's creditworthiness below that of Egypt, deepening the debt troubles for two of the weakest countries in the euro zone.

The bonds of both countries were hit, with Portuguese 10- and 2-year yields jumping to euro lifetime highs and Greek 2-year yields rising 10 basis points to 15.46 percent.

Our view is that this really is a game changer, S&P analyst Frank Gill told journalists, referring to the European Stability Mechanism, which European leaders agreed last week will replace the European Union's bailout fund in 2013.

We do think it is clearly negative for holders of commercial debt, that is our view, that it will weigh on countries' capacity to serve their commercial debt, he said.

The downgrade of Portugal added to Lisbon's woes, coming after the Bank of Portugal warned on Tuesday the country may need substantial new austerity measures to ensure it can meet budget goals.

Lisbon is grappling with how to regain investor confidence following the minority government's resignation last week after the opposition rejected its austerity plan in parliament, prompting many economists to predict the country will need a bailout soon like Greece and Ireland.

Given Portugal's weakened capital market access and its likely considerable external financing needs in the next few years, it is our view that Portugal will likely access the EFSF and thereafter the ESM, Standard & Poor's said.

European leaders agreed a new package of anti-crisis measures at a two-day summit last week but delayed an increase in the size of the euro zone's rescue fund, known as the European Financial Stability Facility. However, they sealed a deal on funding the ESM, a new, permanent safety net that will become operational in mid-2013.

Silvio Peruzzo, an economist at RBS, said S&P sees a possibility that bond holders could be at risk under the new mechanism.

If a country defaults, the ESM, as a senior creditor, gets the money before investors and investors may take a loss, he said.

Standard & Poor's downgraded Portugal by one notch to BBB-, adding to a two-notch cut last Thursday. Still, the S&P's Gill said Portugal was still highly creditworthy and the market was exaggerating default concerns.

The rating cut has been mostly priced in, but it's not just that. I think it's in Portugal's best interests to take a bailout soon rather than continue raising debt at much too high interest rates, said Deutsche Bank economist Gilles Moec.

The agency downgraded Greece by one notch to BB-, deeper into junk territory, and below Turkey and Egypt which are at BB.

It is not a surprise as Greece was on negative watch, said analyst Ben May at Capital Economics. Obviously, it is a reminder that Greece has lots of problems. We continue to think that a debt restructuring is likely.

Gill of the S&P said the new bailout mechanism was also likely to impact the rating of Ireland, which has a grade A-, three levels above Portugal.

The Athens bourse's general index <.ATG> fell 0.4 percent, with Greek banks <.FTATBNK> among the worst performers, losing 3.66 percent, after the downgrade. Portuguese <.PSI20> stocks fell slightly, with banks falling more than two percent.

The Greek finance ministry said S&P's downgrade was based on an erroneous evaluation of last week's EU summit decisions.

It does not reflect the effort and success of the Greek economic policy programme or Greece's economic prospects, the ministry said in a statement.

Earlier on Tuesday, in its spring economic report, the Bank of Portugal said there were risks of the country missing budget goals this year, adding that in 2012 the pressure for more measures could be greater, depressing the economy.

In 2012 the additional, permanent measures necessary to reach the goal promised by the authorities reach a very substantial size, the bank said.

The report forecast economic contraction of 1.4 percent this year and growth of 0.3 percent in 2012 but it said those projections did not include likely additional austerity measures and deleveraging in the economy. Last year the economy grew an estimated 1.4 percent.

Adding to Lisbon's and Athens' troubles, there were further signs pointing to an increase by the European Central Bank in its main interest rate next month from a record low as the rest of Europe's recovery gathers steam and peripheral economies suffer.

It is highly probable that there will be a change in interest rates in April, but it is not certain, said ECB Governing Council member Jozef Makuch.

(Additional reporting by Martin Santa in Bratislava; editing by Stephen Nisbet)

(Writing by Axel Bugge; editing by Stephen Nisbet, Ron Askew)