ALBANY, N.Y. — The New York attorney general’s office has ordered Donald Trump’s charitable foundation to immediately stop fundraising in the state, saying it isn’t registered to do so.

The head of the attorney general’s Charities Bureau, James Sheehan, wrote in a letter to a lawyer for the Republican presidential nominee’s foundation that the failure to stop immediately and answer demands for all delinquent financial reports within 15 days “shall be deemed a continuing fraud upon the people of the state of New York.” The letter was dated and sent Friday.

Democratic Attorney General Eric Schneiderman has been investigating the Donald J. Trump Foundation following Washington Post reports that foundation spending personally benefited the presidential candidate. The newspaper, citing tax records, also reported that the charity has been funded entirely from outside donations since 2008, when the candidate made his last contribution to it.

The attorney general’s office said the Trump Foundation had a registration for an organization with assets in New York but the law requires a different registration for those that solicit more than $25,000 a year from the public.

“Based on information received by the Charities Bureau to date, the Trump Foundation was engaged in solicitation or fundraising activities in New York State in 2016 and was not registered with the Charities Bureau pursuant to Article 7-A, and thus was not permitted to engage in such activity during this period,” Sheehan wrote.

The Trump campaign has said the foundation intends to cooperate with the investigation. The campaign previously called Schneiderman “a partisan hack who has turned a blind eye to the Clinton Foundation for years and has endorsed Hillary Clinton for president.”

“While we remain very concerned about the political motives behind A.G. Schneiderman’s investigation, the Trump Foundation nevertheless intends to cooperate fully with the investigation,” Trump campaign spokeswoman Hope Hicks said Monday.

In September interviews, Schneiderman told Politico that in June his office had communicated with foundation lawyers about what appeared to be an unlawful campaign contribution and didn’t make a public fuss about it and hold a press conference.

“If I’m a traffic cop, but I’m a Democrat, and (Trump) speeds by me, I have to give him a ticket. It’s that simple. Charities have to follow the rules,” Schneiderman told “CBS This Morning.”

His spokesman Eric Soufer said Monday, “The attorney general’s office is the sole regulator of charities in New York State, and when evidence of clear misconduct is brought to our attention, we take action.”