The investigation’s referral to the I.R.S. theoretically could expose Mr. Trump to a wide range of potential punishments.

For example, the I.R.S. could seek to revoke the foundation’s tax-exempt status. The agency could even do so retroactively, which would stick the foundation with a corporate tax bill going back years.

Ms. Underwood’s petition noted that Mr. Trump signed the foundation’s tax returns, in which he stated, under penalties of perjury, “that the foundation did not engage in transactions with interested parties, and that the foundation did not carry out political activity.”

That is the sort of information that investigators would weigh in determining whether he should be charged with filing a false tax return, according to attorneys who have worked on criminal cases that were investigated by the I.R.S. and brought by the Justice Department. They said that Mr. Trump could be especially vulnerable because of his repeated involvement with the foundation, directing it to spend money on specific activities.

“People have gone to prison for stuff like this, and if I were representing someone with facts like this, assuming the facts described in this petition are true, I would be very worried about an indictment,” said Jenny Johnson Ware, a criminal tax attorney in Chicago. Ms. Ware has represented clients investigated for filing false charitable tax returns as well as wealthy individuals in tax disputes with the I.R.S. and the Justice Department. “If I were representing someone who had committed these acts, who was not president of the United States,” she said, “I would be looking to negotiate a resolution.”

The attorney general’s suit said the Trump Foundation was used at least five times for “self-dealing” — making payments to settle Mr. Trump’s business disputes. That could violate a law prohibiting the use of nonprofit charities for private interests.

The suit also cites a campaign event in Iowa where $2.8 million was raised for the foundation. Senior campaign staff controlled how and when those funds were eventually spent, the suit said.