The New York State Department of Taxation and Finance has opened an investigation into whether the Donald J. Trump Foundation violated state tax laws, a move that could lead to a criminal referral for possible prosecution, according to two state officials familiar with the inquiry.

The officials would not say when the investigation started, or what activities it may be scrutinizing. But it seemed likely that the inquiry may cover some of the same issues raised by the New York attorney general, Barbara D. Underwood, in a lawsuit filed against the Trump Foundation last month.

The attorney general’s lawsuit accused the foundation of violating campaign finance laws, self-dealing and illegally coordinating with the Trump presidential campaign. It seeks to dissolve the foundation, recover millions of dollars in restitution and temporarily bar President Trump and three of his children from serving in leadership positions at any nonprofit operating in New York.

A criminal inquiry could reveal additional information beyond the scope of the lawsuit, such as the president’s tax returns. If the investigation found possible criminal activity, it could then refer its findings to a law enforcement agency, such as the state attorney general’s office or a district attorney. That agency could present the findings to a grand jury, according to the two officials, both senior members of Gov. Andrew M. Cuomo’s office, who spoke on the condition of anonymity to protect an active investigation.