The New York attorney general's office has ordered the Trump Foundation to immediately stop fundraising in the state, saying it isn't registered to do so.

James Sheehan, head of the attorney general's Charities Bureau, wrote in a letter dated Friday 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."

New York Attorney General Eric Schneiderman has ordered the Trump Foundation to immediately stop soliciting donations in New York. (Mike Segar/Reuters)

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

The attorney general's office said the 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 said the foundation intends to co-operate with the investigation. The campaign has 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."

The Post reported that the foundation used donations given by others to pay for Trump's legal settlements, political contributions and even purchase portraits of Trump. The Post has also reported that the foundation solicited donations from the public without the required certification under New York state law.

No income taxes for 18 years?

This news follows a report Saturday in the New York Times that said Trump reported losses of more than $900 million on his 1995 income tax returns filed in three states. Experts say losses that size could have allowed him to forgo paying federal income taxes for nearly two decades.

The revelation from a portion of Trump's tax returns for that year gives the most detailed insight yet into the Republican nominee's tax history during a time when his opponent, Democrat Hillary Clinton, has suggested Trump is hiding something from voters.

Some details of Trump's tax history had surfaced before in documents from state gaming regulators and court cases. But even with the latest disclosure by the Times, several questions remain unanswered about Trump's more recent finances because the information released to date is only partial and much of it dated.

Here is what we do know:

Trump has avoided taxes before

Trump reported paying no federal income taxes in 1978, 1979, 1984 and likely at least two other years in the early 1990s, according to documents unearthed by the Daily Beast, Politico and the Washington Post. Like the 1995 tax returns disclosed by the Times, Trump avoided paying taxes in those years by reporting losses that wiped out his gains.

For instance in 1984, Trump reported that he lost money and claimed on his personal tax returns that he was primarily a consultant, whose consulting business had more than $600,000 in expenses and no income. At the time, Trump had just finished Trump Tower and was quoted extensively in news reports talking up his business success.

It's unclear if the IRS questioned Trump's federal tax returns that year, but New York City tax authorities challenged his claims. The city fought with Trump for several years after he appealed his city tax bill. Trump lost that fight and had to pay the city taxes on more than $1 million in income.

What the Times found

The Times reported that Trump posted a net loss of $915,729,293 in federal taxable income in 1995. It was already well known that Trump was losing money during the early to mid-1990s, a time when his casinos fell into financial turmoil and some of his businesses filed for bankruptcy. But the records obtained by the Times show losses so large that they could have allowed Trump to avoid paying taxes for up to 18 years.

The newspaper reported that Trump made only $6,108 in wages, salaries and tips in 1995. He also reported $7.4 million in interest income and a loss of $15.8 million on his real estate and partnership holdings that year, the newspaper said.

The Times said it based its story on the first pages of Trump's 1995 state income tax filings in New York, New Jersey and Connecticut. The documents were anonymously mailed to one of the newspaper's reporters. Former Trump accountant Jack Mitnick, who prepared Trump's taxes that year, told The Times the documents were authentic, pointing out that they reflect a printing error from his tax preparation software that he corrected by manually inserting some numbers using a typewriter. Those numbers are slightly misaligned on the documents.

Trump responds

During a campaign stop in Pueblo, Colo., on Monday, Trump said he "brilliantly used" U.S. tax rules to his advantage in trying to limit the amount he paid in taxes, arguing it helped him survive a difficult period in the real estate market.

"I was able to use the tax laws of this country and my business acumen to dig out of the real estate mess ... when few others were able to do what I did," Trump said.

Hillary Clinton, the Democratic nominee for the Nov. 8 election, has seized on the report, arguing the tax records undercut Trump's business acumen.

"What kind of genius loses a billion dollars in a single year? This is Trump to a T, he's taken corporate excess and made a business out of it," Clinton told a rally in Toledo, Ohio, on Monday.

Can a man who lost $1 billion in one year, stiffed small businesses, and may have paid no taxes really claim he's "good at business"? <a href="https://t.co/ZeXgrkJhzj">pic.twitter.com/ZeXgrkJhzj</a> —@HillaryClinton

Clinton has repeatedly called on Trump to release his full returns, as presidential candidates have done in the past.

Trump was dismissive of the Times' story in his Pueblo remarks, saying the media was "obsessed with an alleged tax filing from the 1990s."

The Trump campaign has not said, however, that the Times' story was inaccurate. Instead, his supporters, including former New York mayor Rudy Giuliani and New Jersey Gov. Chris Christie have contended that Trump's aggressive use of provisions under U.S. law to minimize his tax liability was evidence of his "genius" as a businessman and real estate investor.

Trump picked up on that theme on Monday. "I have brilliantly used those laws," he told the crowd in Pueblo.

Before running for president, Trump said he would release his tax returns if he ran. But since he announced his candidacy last year, Trump has refused, bucking a tradition to which presidential nominees have adhered since 1976.

Trump has repeatedly said he won't release the documents because he says they're under audit by the Internal Revenue Service and his attorneys have advised against him making them public. Tax experts and IRS commissioner John Koskinen have said such audits don't bar taxpayers from releasing their returns.

Trump's running mate, Indiana Gov. Mike Pence, has released 10 years of his tax returns. Clinton has released nearly 40 years of her tax returns.

Republican presidential nominee Donald Trump takes questions from a friendly audience at the Retired American Warriors conference. (Mike Segar/Reuters)

What returns could show

So far, only portions of any of Trump's tax returns have been made public. And everything that has been made public is decades old.

Trump's more recent tax returns — when he was likely more successful — would show his income sources, the type of deductions he claimed, how much he earned from his assets and what strategies Trump used to reduce his tax bill.

Full returns would also show how much Trump has personally donated to charity. The Times noted that the documents they received do not indicate how much Trump donated to charity in 1995, though Trump chose not to donate to a handful of organizations listed on the state tax documents including the New Jersey Vietnam Veterans' Memorial Fund.

Trump has regularly boasted of his charitable giving, but The Associated Press reported more than a year ago that there is little record of substantial personal philanthropy.

What voters say

Voters are split along party lines whether it's important for candidates to release their tax returns, but more than half believe Trump isn't releasing his returns because he's hiding something.

An Associated Press-GfK poll last month found that 46 per cent of registered voters say it is very important for candidates to release their tax returns, though Democrats were more likely to say so than Republicans. A recent Monmouth University poll found that a little more than half of voters think Trump isn't releasing his tax returns because he is hiding something from the public.