Federal prosecutors have opened an investigation into trading at Goldman Sachs, raising the possibility of criminal charges against the Wall Street giant, according to people familiar with the matter.

While the investigation is still in a preliminary stage, the move could escalate the legal troubles swirling around Goldman.

The Securities and Exchange Commission, which two weeks ago filed a civil fraud suit against Goldman, referred its investigation to prosecutors for the Southern District of New York, which has now opened its own inquiry.

Goldman has vigorously denied the accusations by the S.E.C., which accused Goldman of defrauding investors involved a complex mortgage deal known as Abacus 2007-AC1.