Buenos Aires in Argentina won the International Olympic Committee (IOC) vote, defeating Colombian city Medellin in the final round.
Since the shortlist was announced, the final three bid cities had faced questioning and assessment from the IOC.
A delegation including Britain’s most successful Olympian, Sir Chris Hoy, British Olympic Association (BOA) chairman Sebastian Coe, organisers, politicians and school pupils had travelled to IOC headquarters in Lausanne for the announcement.
Congratulating Buenos Aires on its victory, bid partners the BOA, the Scottish government and Glasgow City Council pledged to continue building on the legacy from last summer’s London Games and next year’s Glasgow Commonwealth Games.
Bid director Paul Bush said: “This bid gave Glasgow and Scotland the chance to show its excellence and sophistication when it comes to staging world-class events.
“It is, of course, disappointing not to win but this was one of the toughest Olympic races of recent times and nothing can take away from the excellent technical and visionary bid put together by all the partners.
“I would like to pay particular tribute to all the young people who were at the heart of this bid from the beginning and who embraced it as their own. They should take immense pride in their achievements and use this journey as the catalyst for further success for themselves and for their city and country.”
Glasgow launched its bid in June 2012 with a promise to put young people at the heart of the Games.