Author Sir Alexander McCall Smith has said his knighthood is a “wonderful thing” and that his famous fictional detective Mma Precious Ramotswe would be “very happy” for him after being honoured by the King.

The writer was knighted for services to literature, academia and charity at an investiture ceremony at the Palace of Holyroodhouse in Edinburgh on Tuesday.

Sir Alexander is the creator of The No. 1 Ladies’ Detective Agency series and he has written and contributed to more than 100 books including short story collections, children’s books and specialist academic titles.

The detective agency series, set in Botswana and featuring the detective Mma Ramotswe, has now sold more than 20 million copies in the English language alone.

Sir Alexander McCall Smith shaking hands with the King
Sir Alexander McCall Smith said he enjoyed chatting to the King during the ceremony (Jane Barlow/PA)

The author, an emeritus professor of medical law at the University of Edinburgh, is also known for series including the 44 Scotland Street novels, the Isabel Dalhousie collection, and the von Igelfeld books.

Speaking after the ceremony, he said: “It’s a wonderful thing, I’m most grateful, it’s a very nice thing to happen so I’m very pleased, but of course obviously behind it there are all sorts of other people who have made it happen so I think of them.”

Asked what Mma Ramotswe would think about the knighthood, he said: “Well I think Mma Ramotswe would be very pleased, she likes jewellery and decorations and she’d say that’s rather a nice badge you’ve got there, so she would be very happy I think, it’s been a long journey I’ve had with her, conversation over many years.

“I wish she could be with us today but she’s entirely fictional.”

Sir Alexander enjoyed speaking to the King and said: “The King is marvellous, he’s an example to all of us, he does all these things and does them so beautifully in such a friendly fashion.”

Professor Paul Mealor smiles while holding up his RVO medal
Professor Paul Mealor has been made a Lieutenant of the Royal Victorian Order (Lesley Martin/PA)

Now 75, Sir Alexander was born in what was then known as Southern Rhodesia, now Zimbabwe, and made Edinburgh his home after studying in the city.

He conceived the idea of the Great Tapestry of Scotland, now housed in Galashiels, and is also a patron of several charities including The Eric Liddell Community, a care charity and community hub in Edinburgh.

Others to be honoured on Tuesday, after being named in the King’s New Year Honours, include Paul Mealor, professor of composition at the University of Aberdeen.

He became a Lieutenant of the Royal Victorian Order – a gift given by the King to people who have served him or the monarchy in a personal way.

Prof Mealor composed Coronation Kyrie for the King’s coronation last year and has composed music for other royal occasions over the past decade, including the wedding of the Prince and Princess of Wales in 2011, and Charles’s 65th, 70th and 75th birthdays.

Chief Superintendent Faroque Hussain shaking hands with The King
Chief Superintendent Faroque Hussain was decorated with the King’s Police Medal during the ceremony (Jane Barlow/PA)

He also composed music for the Honours of Scotland service which was held at St Giles’ Cathedral in Edinburgh last summer to mark the coronation.

Speaking after being honoured at the ceremony on Tuesday, he said: “It was an enormous pleasure and a huge honour. It’s very rare that you get to go inside this amazing palace and then to get those moments with His Majesty in which you’re thanked for the work that you’ve done is very, very special.

“We talked about the Honours of Scotland service which I was music adviser for, along with some others, and it was great to relive those moments when we were assisting His Majesty in putting that together, it was an enormous pleasure.

“I composed three pieces for the Honours of Scotland service, a fanfare, a Gaelic setting and then the final march and the Call of Lochnagar, and there are other things on the way.

“It was an incredible surprise to get the award. When you are asked to do these things, you do it for the honour of doing them, you don’t do it for one of these, but it’s always wonderful when your work is recognised and when His Majesty thanks you in this way, it means a great deal.”

Pc Stephanie Rose, in police uniform, shakes hands with the King
Pc Stephanie Rose shook hands with the King as she received her medal (Jane Barlow/PA)

Others honoured included Professor Sir Jim McDonald, principal of the University of Strathclyde, who was appointed Knight Grand Cross of the Order of the British Empire for services to engineering, education and energy.

Liz Smith, a former Scotland cricketer who is now a Conservative MSP, became a CBE for services to sport.

Members of the emergency services were also among the more than 50 people honoured on Tuesday.

They included Police Scotland Chief Superintendent Faroque Hussain, who received the King’s Police Medal.

Mr Hussain, from Largs, North Ayrshire, is the first ethnic minority police officer to progress through the ranks from constable to the post of chief superintendent.

Retired chief superintendent Carol McGuire, from Symington in South Ayrshire, and Police constable Stephanie Rose, from Denny near Falkirk, also received the King’s Police Medal.