The decision was announced by Commonwealth Games Federation (CGF) president Mike Fennell after its general assembly meeting held in the Sri Lankan capital.
"I announce the winner, the winner is Glasgow," Fennell told his audience, adding that Glasgow had secured 47 votes against 24 for Abuja out of a total of 71 member countries.
Glasgow and the Nigerian capital were the only candidates left to host the 20th edition of the quadrennial event.
In early March, the Atlantic Canadian city of Halifax withdrew its bid amid criticism of the growing cost of hosting the Games and a perceived lack of transparency in the bid process.
Nicola Sturgeon, the country's Deputy First Minister, told the Glasgow 2014 bid Web site (www.glasgow2014.com) the decision was "a momentous day for Scotland, not just in terms of sporting achievement but also in our bid to inspire a whole generation to live healthier, more physically active lifestyles.
"It'll also be a huge boost to our economy thanks to all the visitors who will come here.
"But perhaps more importantly, the Government is determined that the Games will provide a springboard for regeneration in some of our most deprived communities right here in Glasgow, as well as an opportunity to create a lasting sporting legacy for Scotland."
DELIGHTED CROWD
News of the victory delighted thousands of flag-waving supporters across the city, including politicians, celebrities and sporting personalities who had gathered in Glasgow's Old Fruit Market, to await the result.
Scotland has hosted the Games twice, in 1970 and 1986, both times in the capital Edinburgh.
Derek Casey, director of the Glasgow bid, had outlined several reasons why the Scottish city should be chosen in a news release issued before the voting.
Casey said "availability of infrastructure, and all the facilities, the endless desire of the Scotland people to see their country being the host country for 2014 Commonwealth Games and the talents of the sportsmen of the country are among them.
"Furthermore, we will assure the safety of all the visitors to the country."
The Evaluation Commission, headed by John Tierney, the CGF's Regional Vice President for Oceania, had visited the two bidding cities during June this year.
Africa has never hosted the event, which began as the British Empire Games in 1930. The 19th Games are scheduled to be held in New Delhi, India in 2010.