Image copyright AFP Image caption Mr Trump and his three eldest children are accused of using it for private and political gain

US President Donald Trump's troubled charity foundation has agreed to close down amid allegations that he and others illegally misused its funds.

The move was announced by the Attorney General of New York State , Barbara Underwood, who will supervise the distribution of its remaining monies.

She has accused Mr Trump and his three eldest children of using it for private and political gain.

The foundation's lawyer accused her of attempting to politicise the matter.

This is just one of several legal cases currently swirling around Mr Trump and his family. Others include a wide-ranging special counsel investigation into alleged ties between the Trump campaign and Russia headed by former FBI chief Robert Mueller.

What do prosecutors say?

Ms Underwood said the case against Mr Trump and his children Donald Jr, Ivanka and Eric would continue.

In a statement, she said there had been "a shocking pattern of illegality involving the Trump Foundation - including unlawful co-ordination with the Trump presidential campaign, repeated and wilful self-dealing, and much more".

She continued: "This amounted to the Trump Foundation functioning as little more than a chequebook to serve Mr Trump's business and political interests."

Under the terms of the deal to shut down the foundation, Ms Underwood said, it could only be dissolved under judicial supervision and could only distribute its assets "to reputable organisations approved by my office".

She added: "This is an important victory for the rule of law, making clear that there is one set of rules for everyone.

"We'll continue to move our suit forward to ensure that the Trump Foundation and its directors are held to account for their clear and repeated violations of state and federal law."

And the Trumps?

In a statement to the BBC, Trump Foundation lawyer Alan Futerfas - signatory to the deal closing the foundation - said: "Contrary to the NYAG's [New York Attorney General] misleading statement... the foundation has been seeking to dissolve and distribute its remaining assets to worthwhile charitable causes since Donald J Trump's victory in the 2016 presidential election.

"Unfortunately, the NYAG sought to prevent dissolution for almost two years, thereby depriving those most in need of nearly $1.7m.

"Over the past decade, the foundation is proud to have distributed approximately $19m, including $8.25m of the president's personal money, to over 700 different charitable organisations with virtually zero expenses.

"The NYAG's inaccurate statement of this morning is a further attempt to politicize this matter."

Mr Trump and his eldest children have yet to comment.

Last June, Mr Trump indicated on Twitter that he was not willing to settle the case, insisting the foundation had done nothing wrong.

Sorry, this Twitter post is currently unavailable.

'Sharper teeth'

Analysis by Anthony Zurcher in Washington

Donald Trump's charitable foundation is being dismantled, but the headaches it has created for the president aren't going away anytime soon.

According to New York Attorney General Barbara Underwood, her investigation into alleged misconduct could still result in millions of dollars in penalties and sanctions against the president and his three oldest children.

As the Washington Post has reported, Mr Trump frequently used his family foundation - which was funded in large part by outside donations - as a resource to settle business lawsuits and, during the 2016 presidential campaign, as a political tool.

The president has been quick to dismiss the New York investigation into his foundation, but with Tuesday's dissolution deal Ms Underwood's criticisms could have sharper teeth.

At the very least, they are sure to resurface as the 2020 presidential election approaches.

How did this come about?

The state's lawsuit against the Trump Foundation was announced over the summer after a two-year investigation which began under previous New York Attorney General Eric Schneiderman.

In October 2016 Mr Schneiderman ordered the Trump Foundation to stop fundraising in New York , after finding it had no proper registration.

President-elect Trump vowed to shut the charitable foundation down in December 2016 , to avoid "even the appearance" of any conflict of interest.

What are the specific allegations?

A 41-page document filed with the New York Supreme Court by the attorney general's office in June 2018 spells out a range of alleged violations of laws concerning non-profit organisations dating back more than a decade.

Mr Trump, who has not contributed any personal funds to the foundation since 2008, was the sole signatory on the foundation's bank accounts and approved all of its grants.

Several pages of the document focus on a charity fundraiser for veterans in Iowa in January 2016, which Mr Trump chose to hold instead of taking part in a TV debate with other Republican presidential hopefuls ahead of the influential state's caucuses.

More than $2.8m was donated to the Trump Foundation at that event. The petition alleges that those funds raised from the public were used to promote Mr Trump's campaign for the presidency, in particular in the Iowa nominating caucuses.

The lawsuit also claims that the foundation paid $100,000 to settle legal claims against Mr Trump's Mar-a-Lago resort; $158,000 to settle claims against one of his golf clubs; and $10,000 to purchase a painting of Mr Trump to hang at another of his golf clubs