By Mark Kinver
BBC News science and nature reporter
There were jubilant scenes in London when the International Olympic Committee chose the city to host the 2012 Games.
Delight as news of the IOC's decision reaches crowds in London
The Games were returning to the city for the first time since 1948, a fact greeted by the winning bid team with a mixture of delight and shock.
For David Stubbs, London 2012's head of environment, it was the culmination of seven years of effort.
He had been asked to join a British Olympic Association working group in 1998 to look into the idea of the UK capital bidding for the Games.
In 2000, he spent two months as an environmental advisor to the Sydney Games' organising committee, gaining first-hand experience of the practicalities of staging arguably the world's largest peace time event.
When London's bid was formally announced in 2003, he had a clear idea of what he felt needed to be done. "It had to be a collaborative exercise. We wanted to approach this in two ways," he told the BBC News website.
"Firstly, get the right experts around us to have a good technical bid and, secondly, engage with the environmental community so that they felt part of the process. Public support was critical."
Measuring the environmental impact of hosting an Olympic Games is one of the compulsory areas that must be addressed if a city wants to stand any chance of being considered as a serious contender.
"The environment chapter embraces a whole range of subjects such as energy, waste, water, biodiversity, cultural heritage, air quality. All of these things had to be looked at," Mr Stubbs said.
An advisory group was set up, made of representatives from NGOs, public authorities, academia and business.
"We did a lot of work with the voluntary groups to get them involved in the process. By the end, they were really championing the whole thing.
"In many ways, my role was that of a facilitator," says Mr Stubbs. "Everyone contributed to the draft documents. We went through a good dozen versions before we got to the [one] that was finally submitted."
February saw the arrival of the International Olympic Committee's (IOC) evaluation commission. The team of inspectors spent four days assessing all aspects of the city's bid.
Nothing was left to chance because the report by the IOC inspectors could make or break the chances of winning the right to host the Games.
One of the commissioners, IOC environmental advisor Simon Balderstone, explained why the candidate cities' bids were subjected to such a comprehensive examination.
"The Olympics are a unique sporting and social phenomenon, bringing together people from more than 200 countries around the world.
"As a high profile, influential event, the Olympic Games should be making sure it is a role model for environmentally friendly practices and creating the opportunity to improve environmental standards," he said.
The eco-credentials of the bid were scrutinised by the inspectors in the form of an hour-long session, involving a range of questions being asked.
"We were looking for maximum positive sustainable legacy in regards to physical infrastructure, redevelopment, design standards, waste management, public transport and environmental consciousness," added Mr Balderstone.
Mr Stubbs recruited Robert Napier, chief executive of WWF, and Jonathon Porritt, chairman of the Sustainable Development Commission, to deliver the presentation and field the inspectors' questions.
"We had a really high-powered environmental team to deliver the case for a London Games."
It was a strategy that appeared to have paid off. In its report, the commission said London's bid showed "strong emphasis on the integration of environmental considerations across all aspects of planning and operations".
For Mr Stubbs, the report's findings were the result of having an environmental voice in the planning process from the outset.
"What was unique about our situation was that we looked at sustainability issues right at the beginning. No other city had ever done that."