Prior to becoming president, Donald Trump was a well-known real estate mogul, television star, and, on paper, a longtime giver to charitable causes. The Donald J. Trump Foundation, which agreed to shutter its doors Tuesday, was often touted by Trump as an example of his benevolence. However, an investigation by New York State's attorney general, Barbara Underwood, found sufficient evidence to say that the organization was not a charitable organization, but merely a tool for Trump to raise his public profile and serve as a vehicle to help reduce the tax burden of his wealthy friends. Trump has denied the allegations.

Read more: Trump Foundation Reaches Deal To Dissolve Amid Lawsuit

“Our petition detailed a shocking pattern of illegality involving the Trump Foundation — including unlawful coordination with the Trump presidential campaign, repeated and willful self-dealing, and much more,” Underwood said in a statement on Tuesday, and went on to describe the organization as nothing more than a “checkbook to serve Mr. Trump’s business and political interests.”

The revelations are the result of more than two years of investigative work by Washington Post reporter David Fahrenthold, who found that the Trump Foundation rarely supported charitable causes but was frequently used to support endeavors that supported Trump himself. In one example Fahrenthold unearthed, the foundation spent $264,631 to renovate a foundation outside Trump Plaza. In another, funds from the foundation were used to purchase a massive portrait of Trump that is currently hanging on the wall of a sports bar at one of his resorts. Further investigation into the foundation’s income sources also show that while the charity bears Trump’s name, most of its money came from personal friends and associates of the president.

“No one who’s smart with their money was giving to the Trump charity because they thought he was helping kids,” national security expert Juliette Kayyem told Boston Public Radio on Wednesday. “You see that guy for two minutes, you know he doesn’t wake up thinking about how he can give meaningful charitable donations.”

Despite these investigations, Trump defended the work of his foundation in several tweets on Wednesday morning, and angrily derided the investigation as a political stunt by New York Gov. Andrew Cuomo.

“The Trump Foundation has done great work and given away lots of money, both mine and others, to great charities over the years - with me taking NO fees, rent, salaries etc.," Trump wrote in a tweet. In another, he continued, “Now, as usual, I am getting slammed by Cuomo and the Dems in a long running civil lawsuit started by ... sleazebag AG Eric Schneiderman, who has since resigned over horrific women abuse, when I wanted to close the Foundation so as not to be in conflict with politics.”

Under the dissolution agreement that the foundation agreed to, the organization will have 30 days to disperse its remaining $1.75 million in assets to a series of charities which must be approved by both a state court and the state attorney general’s office.