Standard & Poor's president Deven Sharma is to leave the credit rating firm at the end of the year.

The decision follows the credit rating agency's decision to downgrade US debt. S&P also faces an inquiry by the justice department into its ratings of subprime mortgage securities.

Company sources said Sharma's decision predated S&P's historic downgrade of US debt earlier this month. The cut presaged a worldwide rout on the stock markets as it threatened to increase the US's cost of borrowing and caused outrage in Washington. The treasury secretary Tim Geithner said the agency's decision showed "stunning lack of knowledge about basic US fiscal budget math", and they had "reached absolutely the wrong conclusion".

Sharma, 55, is set to step down on 12 September and will be replaced by Douglas Peterson, 53, currently the chief operating officer of Citibank, the banking unit of Citigroup. Shareholders are currently pressing for a breakup of S&P's parent company, McGraw-Hill. Sharma will remain with the company until the end of the year to help oversee McGraw-Hill's review of its businesses.

"We are pleased to welcome Doug to the important role of president of Standard & Poor's as it continues to build on the enhancements of recent years and accelerates global growth," Harold McGraw III, McGraw-Hill's chief executive, said in a statement. "As we welcome Doug, I particularly want to thank Deven for his dedicated leadership of S&P."

S&P downgraded US debt from AAA to AA+ earlier this month and issued a report that criticised US debt levels, said not enough was being done to cut costs and raise revenues and slammed the political infighting that accompanied the US's decision to raise its debt ceiling. The move, a first since S&P began rating the credit-worthiness of railroad bonds in 1860, came as ratings rivals Moody's and Fitch said they were maintaining the US's triple-A rating but had put the US on watch.

The US attacked S&P after the downgrade, with a treasury officials accusing the firm of making a $2tr error in its calculations. Last week the New York Times reported the justice department was investigating whether the S&P improperly rated dozens of mortgage securities in the years leading up to the financial crisis. The investigation reportedly started before the debt downgrade.