The Justice Department is investigating whether the nation’s largest credit ratings agency, Standard & Poor’s, improperly rated dozens of mortgage securities in the years leading up to the financial crisis, according to two people interviewed by the government and another briefed on such interviews.

The investigation began before Standard & Poor’s cut the United States’ AAA credit rating this month, but it is likely to add fuel to the political firestorm that has surrounded that action. Lawmakers and some administration officials have since questioned the agency’s secretive process, its credibility and the competence of its analysts, claiming to have found an error in its debt calculations.

In the mortgage inquiry, the Justice Department has been asking about instances in which the company’s analysts wanted to award lower ratings on mortgage bonds but may have been overruled by other S.& P. business managers, according to the people with knowledge of the interviews. If the government finds enough evidence to support such a case, which is likely to be a civil case, it could undercut S.& P.’s longstanding claim that its analysts act independently from business concerns.

It is unclear if the Justice Department investigation involves the other two ratings agencies, Moody’s and Fitch, or only S.& P.