David Cameron personally intervened to extend taxpayer funding to London's controversial Garden Bridge project, despite warnings from officials of the financial risks involved, the Whitehall spending watchdog has found.

An investigation by the National Audit Office (NAO) found minsters overrode the advice of civil servants in order to provide millions of pounds in loan guarantees for the planned footbridge over the River Thames.

Cabinet Secretary Sir Jeremy Heywood even fired off a memorandum to the Department for Transport (DfT) expressing the "frustration" of Mr Cameron and then chancellor George Osborne at the hold-ups to the funding.

The then transport secretary Sir Patrick McLoughlin finally issued a formal ministerial direction to his officials ordering them to underwrite cancellation liabilities of £15 million if the project did not go ahead.

However, the NAO said there was now a "significant risk" that the bridge would not be built and that up to £22.5 million of taxpayers' money may have to be written off.

The findings come after London Mayor Sadiq Khan last month ordered a review of the project amid concerns about the funding.

The NAO said the initial commitment to provide £30 million of taxpayers' money was made by Mr Osborne to Mr Khan's predecessor, Boris Johnson, without any involvement of the DfT.

Under the terms of agreement, announced by Mr Osborne in his 2013 Autumn Statement, the mayor was to contribute a further £30 million while the remainder - then estimated at £115 million - was to come from private sources.

The DfT agreed to make that investment, despite an assessment of the business case concluding there was a "significant risk" that the bridge could represent "poor value for money".

The department sought to protect taxpayers' money by imposing a cap of £8.2 million which could be spent by the trust before construction began.

But on three separate occasions between June 2015 and May 2016 this was relaxed - twice against the advice of DfT officials.

On the final time, the Permanent Secretary Philip Rutman warned the Government was already taking on more risk than private sector donors.

"He believed the department to be at the very limit of what he regarded as proportionate or prudent financial exposure to the risk of the project not proceeding," the NAO said.

"On 24 May, he sought a ministerial direction to provide indemnity against cancellation liabilities.

"This was in the context of an email from the Cabinet Secretary informing the accounting officer that the then prime minister and the then chancellor felt frustration at the need for a direction."

The guarantees - which were issued even though the trust has not yet secured all the land it needs to build the bridge - took the DfT's total exposure to £28.5 million.

That was subsequently reduced by Sir Patrick's successor, Chris Grayling, to £22.5 million and since June 2016 the DfT has been receiving written monthly updates from the trust on the status of the project.

However, the NAO said it did not include "standard project performance information" such as progress against timetable and budget, or the progress the trust was making on meeting its fundraising targets.

Of the four conditions originally set out by Mr Osborne when he agreed to provide taxpayer funding, only one had been fulfilled, while responsibility for the long-term maintenance of the bridge if the trust was unable to raise sufficient funds had yet to be agreed.

Meg Hillier, chair of the Commons Public Accounts Committee which oversees the work of the NAO, said: "It worries me that, whenever the Garden Bridge Trust runs into financial trouble, the DfT releases more taxpayers' money before construction has even started.

"I hope the Government learned its lesson from the Kids Company fiasco, when for years it bailed out the charitable trust every time it came begging."

Transport Minister Lord Ahmad said: "The Government remains supportive of the Garden Bridge project and ministers took into account a wide range of factors before deciding whether or not to make funding available.

"The taxpayer, however, must not be exposed to any further risks and it is now for the trust to find private-sector backers to invest in the delivery of this project. We will consider the NAO's findings carefully."