Captain Walter Barrie, from Lanark, was playing in a game between British soldiers and members of the Afghan National Army at his base when he was shot at close range in the Nad-e Ali district of Helmand province. The man who killed him was a rogue member of the Afghan army.
The captain, 41, had been mentoring and advising a brigade of the Afghan National Army to take over security in an area in the south of the country.
His wife, Sonia, said: "He was great man, a doting and amazing father and a fantastic husband. He was much loved and will be missed by many."
The death of Captain Barrie, who leaves a 15-year-old son, Callum, means the number of UK service members who have lost their lives since operations in Afghanistan began in October 2001 is now 438.
At least 54 international Allied troops have died as a result of what are known as "green-on-blue" attacks, where Afghans turn their weapons on their coalition colleagues.
Captain Barrie, of The Royal Scots Borderers, 1st Battalion The Royal Regiment of Scotland, had served for 25 years, including tours of Iraq, Bosnia, Kosovo and Northern Ireland. He had previously been in Afghanistan in 2008 and his latest deployment started on August 31.
His fellow officers also paid tribute to him.
Lieutenant Colonel Benjamin Wrench, commanding officer of the Royal Scots Borderers, said: "His ability to build relationships and rapport has always made an impact on those who met him.
"He enriched the lives of everybody he came across. His winning personality and wit will be sorely missed, as will the banter we often had as a result of his fanatical support for Rangers.."
Lieutenant Colonel Jim Archibald said: "Walter's cutting, self-deprecating wit, easy-going manner and endearing personality will never be forgotten by all who had the privilege and pleasure to have met and worked with him."
Major Andy Lumley, officer commanding of D Company, , said: "If the sheer number and spread of a man's friends can be made a judgment of his quality then Captain Barrie was a man of the greatest stripe.
"Walter was a truly wonderful man – I am lucky to have counted him as my friend."