Republican presidential candidate Donald Trump’s foundation has 15 days to comply as a registered charity in New York, according to the state’s attorney general.

NEW YORK — The New York attorney general has ordered the Donald J. Trump Foundation, headed by the Republican presidential candidate, to immediately “cease and desist from soliciting contributions in New York.”

The agency said that the foundation was in violation of state law by raising money in New York while failing to register itself as a charity and to file financial statements.

“The failure immediately to discontinue solicitation and to file information and reports … shall be deemed to be a continuing fraud upon the people of the state of New York,” read a harshly worded letter from the attorney general’s office dated Friday and made public Monday on the agency’s website.

The agency gave the Trump Foundation 15 days to comply. The most immediate concern appears to be a Jan. 28 fundraiser for veterans held in Des Moines, which made headlines because Trump attended it in place of a Republican primary debate, which he skipped over his feud with his Fox News’ Megyn Kelley. At the same time, Trump started raising money from the general public through the website Despite all the publicity, Trump neglected to file the necessary registration and disclosure statements for public fundraising.

“Until very recently, the funding for the Donald J. Trump Foundation came from friends and business associates, but this definitely was public fundraising and he was required to file,” said Leslie Lenkowsky, the former head of the Corporation for National and Community Service and a professor studying philanthropy at Indiana University. “These may be technicalities, but they are important technicalities. Charities tug on the heartstrings of the public, raising money for widows and orphans. We don’t want donors to be defrauded.”

However, larger questions have been raised in recent weeks about the Trump foundation. Unlike other family foundations, Trump and his relatives have given little of their own money, using the foundation instead as a way to raise money from others, while publicizing the Trump name, The Washington Post reported last week. In one case, the newspaper reported, Trump used $20,000 earmarked for charity to buy a 6-foot-tall painting of himself.

In another case, Trump paid a penalty to the IRS for a 2013 donation by the foundation to a campaign group supporting Florida Attorney General Pamela Bondi.