West Ham finally secured a deal as anchor tenants for the Olympic Stadium after the government agreed to put in an extra £25m towards estimated costs of converting the venue.
The additional money takes the Treasury's contribution to around £60m.
Adapting the stadium could cost between £150m and £190m.
But the deal was secured only after West Ham agreed to increase their own funding of the project by £5m, to £15m. They will pay around £2m a year rent.
Although the club were appointed preferred bidders by the London Legacy Development Corporation (LLDC) three months ago, there were still fears the agreement could collapse.
It is understood the main sticking point was how to finance the transformation of the 80,000-seater athletics stadium into a 60,000-capacity multi-sports arena fit for Premier League football with retractable seating and an extended roof.
Initially the club had been reluctant to pay anything, but over time they increased their contribution to £10m and are now prepared to pay £15m up front towards the conversion.
The rest of the money will be drawn from a range of sources, including London Mayor Boris Johnson's budget, a £40m loan from Newham Council and around £20m of borrowings by the LLDC. The budget also includes what officials describe as a "significant" contingency.
To guarantee the 99-year lease, West Ham also had to agree to pay a proportion of any future sale of the club back to the LLDC.
Johnson argued that the move into the stadium significantly enhanced West Ham's value and that the public purse should share in any profits generated from a sale by owners David Gold and David Sullivan.
In response, West Ham have agreed to pay a one-off windfall back to the LLDC if they sell the club in the next 10 years. West Ham say that is a sign of Gold and Sullivan's long-term commitment to the club.
The deal will be a huge relief to the mayor and the government, who feared the stadium could become a major drain on taxpayers. Under the terms of the lease, the club will also pay around £2m a year in rent - almost half the annual running costs.
They will share catering and hospitality revenue with LLDC but it is understood West Ham will take all ticket and merchandising income.
Despite the saga drawing to a close, there will still be those who question why it has taken so long to secure a deal with the only realistic bidder.
The LLDC argues that it had to take extra time to ensure every part of the proposed contract was checked after two previous attempts to install West Ham as tenants collapsed following legal challenges.
Leyton Orient chairman Barry Hearn is seeking a judicial review of the decision but the LLDC is confident that will not stall the process.
Sources insist Hearn is contesting the LLDC's failure to do a joint deal with the Premier League team and Leyton Orient, rather than the decision to place West Ham in the stadium.
Others may accuse Johnson and Government officials of giving West Ham the stadium on the cheap and failing to extract more money from the Premier League team to help pay for conversion costs.
They will counter that by arguing that the alternative would have been a longer and potentially more costly outcome for taxpayers.
West Ham have always insisted that their presence in the stadium will help drive the legacy strategy and raise extra income for the Queen Elizabeth Olympic Park.
The LLDC and West Ham will now work together to sell the naming rights for the stadium to a blue chip sponsor.
Initial talks with the International Olympic Committee and the British Olympic Association have begun on whether they can use the word 'Olympic' in any future naming of the venue.
This is thought to be extremely unlikely unless the sponsor of the stadium is also one of the Olympic movement's big commercial partners. The IOC fiercely protects its right to exploit the Olympic brands for commercial purposes.
In addition to extending the roof and reducing the seating capacity, contractors will have to install a retractable seating system to convert the venue from athletics to football mode within days.
Seats will slide over the running track to bring West Ham fans closer to the action.
The LLDC will start work on the roof in the autumn and officials hope it will be ready for the autumn of 2015 - in time for the Rugby World Cup.
After that the stadium will close again to reconfigure the stadium's lower seating bowl and re-open in time for West Ham to start playing their games there in August 2016.