It will be the second time the Games have been held in Australia. In 1956, Melbourne hosted what became known as the Friendly Games.
Sydney's Games, to run from September 16 to October 1, are certain to become known as the Millennium Games.
They will be the biggest event in the city's history, attracting 15,000 athletes and officials from as many as 200 countries, an estimated 250,000 visitors, and a television audience comprising two-thirds of the world's population.
Sydney pulled it off after a frantic week of rumours about its deteriorating position. The fear was that Beijing, despite a poor start to its Monte Carlo campaign, would still have the numbers despite Sydney being the front-runner for much of the 2 1/2-year battle.
Both Mr Keating and Mr Fahey congratulated the people behind the bid.
The Prime Minister said: "All the bid workers and people such as Foreign Affairs officers who put in such a great effort can feel justifiably proud.
"Their efforts successfully brought together Sydney's technical advantages, its tremendous sporting facilities, its beauty, and its people."
Mr Fahey said that every Australian could feel "immensely proud" of the people who had worked so hard to win the Games. "Congratulations to everyone.
Mr Bruce Baird, the minister responsible for the bid, called it "a great day, not just for Sydney but for Australia. Sydney will be on the world stage for the next seven years as we prepare for the Olympics".
The Games are also a just reward for Mr Rod McGeoch, the lawyer who 2 1/2 years ago become chief executive of the bid company.
He admitted to a sense of relief, thanked his staff and the bid's corporate supporters, and forecast a "great time for Sydney".
"People probably think I'm pontificating," he added. "But when you really think about it, if you're free and equal, that's okay, but if nobody really cares about the community or each other then you really haven't got anything; if nobody gives a bugger about anybody else then it really isn't a very nice place to live."
The Olympic movement has come under attack from many quarters in recent years as being more concerned with politics than its historic charter: sport.
A win for Beijing was likely to have increased both the size and scope of that attack, with charges of a sell-out to big business, and a disregard of human rights.
But Sydney's victory is one for sport over politics, a win which will be seen as being in the best interest of those at the core of the Olympic ideal -the athletes.