S&PLogo
A view shows the Standard & Poor's building in New York's financial district on Feb. 5, 2013. Reuters/Brendan McDermid

Ratings agency Standard & Poor's downgraded several U.K. and German banks, including Deutsche Bank AG and Barclays Plc, saying it considers government support for these banks to be uncertain.

The rating arm of McGraw Hill Financial Inc downgraded Germany's Deutsche Bank and the U.K.'s Barclays and Royal Bank of Scotland Plc to "stable" and Commerzbank AG to "negative".

Deutsche Bank, the largest German lender, has struggled to restore an image tarnished by a raft of regulatory and legal problems. The bank's co-CEOs, Anshu Jain and Juergen Fitschen, resigned earlier this week.

S&P downgraded Barclays by one notch to "A negative" and Deutsche Bank to "BBB positive," three notches above junk territory.

The agency also affirmed its ratings on Lloyds Bank Plc and HSBC Bank Plc and said the outlooks are stable.