A VisitBritain study showed Edinburgh had 1.25 million visits in 2012, topped only by London, with Manchester third, Birmingham fourth, and Liverpool fifth.
Visits increased last year from the BRIC countries (Brazil, Russia, India and China) with Scotland having 30% more BRIC visits, including a 54% rise to Glasgow, which came sixth.
Meanwhile the north east of Scotland also saw an increase as statistics showeed that Aberdeen attracted more Norwegian visitors.
VisitScotland chairman Mike Cantlay said: “It is fabulous to see Edinburgh and Glasgow proving so popular among overseas visitors.
“Both cities boast a wealth of things to see and these figures bode well for 2014, when we welcome the world with the Glasgow Commonwealth Games, the Ryder Cup at Gleneagles and the second Year of Homecoming.
“The emerging markets of Brazil, Russia, India and China are important to Scottish tourism as they show considerable potential for growth. Our studies show that visitors from these countries enjoy quintessentially Scottish things, including our spectacular scenery, our castles, golf and whisky.”
The top 10 destinations in terms of visits by overseas residents in 2012 were:
1. London 15,461,000
2. Edinburgh 1,256,000
3. Manchester 932,000
4. Birmingham 713,000
5. Liverpool 550,000
6. Glasgow 521,000
7. Oxford 430,000
8. Cambridge 398,000
9. Bristol 395,000
10. Brighton and Hove 345,000