Andy Murray win and sunshine spark summer high street boom
Andy Murray's triumph at Wimbledon and sustained hot weather combined to give Scotland's high streets their best performance for two years.
Sales last month were up 4% on July 2012 meaning the country performed better than the rest of the UK which recorded a 3.9% rise.
Sales of barbecue food, ice cream and fruit sales were up, along with summer clothes and shoes.
But furniture and homeware retailers suffered.
The figures reveal the best growth since April 2011 on Scottish high streets.
Fiona Moriarty, director of the Scottish Retail Consortium (SRC), said: "A double whammy of feel-good factors pushed Scottish sales growth into record-breaking territory in July.
"Sunshine and sporting successes boosted the public mood and willingness to spend further after a promising pick-up in June. This helped to deliver an excellent showing which tops the UK total for the first time since March 2011."
The July increase comes after retailers saw total sales rise by 2.8% in June and the new SRC KPMG Scottish Retail Sales Monitor also showed that like-for-like sales, which strip out factors such as new store openings, had increased by 1.4% in July when compared with 12 months ago.
Total food sales were 5.6% higher last month than they had been in July 2012 - the best growth the sector has seen since April 2011.
Among the best sellers were beer, soft drinks and ice cubes as well as strawberries and raspberries.
Non-food sales were up 2.6%, which was the largest increase since December 2009.
Summer clothes sold well, as did sandals, canvas shoes and protective suncream.
However, sales of tablet computers slowed as consumers wait for the latest versions of the devices to come on to the high street.
Ms Moriarty said: "Appetite for 'indoor living' was diminished and many people prioritised putting their money towards updating their summer wardrobes."
She added: "It's too early to tell whether what we're seeing is a welcome but short-lived uplift or the beginnings of longer-lasting economic recovery. But this run of good growth, bringing the three month average to 2.5%, means things are certainly looking up for the time being."
David McCorquodale, head of retail at KPMG, said: "Andy Murray's Wimbledon victory undoubtedly started the rally with celebration parties driving food and drink sales early in the month. A prolonged spell of summer weather then boosted sales of barbecues, burgers and beer.
"Those with most to smile about were the fashion retailers who, following an extended cold spring, finally got reward from consumers who had confidence in the weather to buy summer clothing.
"July was without doubt a good month on the Scottish high street and, like the weather, was welcome and overdue. It is with cautious optimism that I look forward to the rest of the year."
Finance Secretary John Swinney said the figures were "another encouraging sign of increasing consumer confidence for 2013".
He added: "The increase in retail sales during July comes on the back of our recent retail sales index which showed good signs of recovery within the retail sector with trade picking up in Scotland for the second quarter in a row."