Barack Obama believes Scotland has "a lot to offer the world" and promised to return after his first visit to the country.

The former US president flew into Edinburgh Airport for a speech in front of politicians and business leaders at a charity dinner in the capital.

However, he made the most of his time by first going to the home of golf for a round at the Old Course in St Andrews.

Philanthropist Sir Tom Hunter invited Mr Obama to speak at a private charity event attended by around 1,200 people, including First Minister Nicola Sturgeon, author JK Rowling and musician Annie Lennox.

Profits from the event, where tables of 10 started at £5,000, are to be split between children's charities in Scotland and the Obama Foundation, set up by the former president and his wife Michelle.

The Herald reported that when asked by Sir Tom what he thought about Scotland, Mr Obama said the country "had a lot to offer the world".

He added: "It is just important we (you) know that and feel confident."

Picture: (AFP / Getty / Jim Young)

The Democrat also vowed to return to experience "real" Scottish weather after playing golf in 26C (78.8F) heat in St Andrews.

He said: "I promise you I will be back because, unless it is raining and blustery, I will not feel I have got the full Scottish experience."

During a lengthy speech, Mr Obama also paid tribute to the victims of the Manchester bombing.

According to the Daily Record, he said: "I am convinced the perpetrators of this act will ultimately be brought to justice and the networks will be dismantled.

"And I know this not simply because of the valour of our military and law enforcement personnel, but because I know the character of our peoples."

Joe Biden and Barack Obama through the years Show all 15 1 /15 Joe Biden and Barack Obama through the years Joe Biden and Barack Obama through the years Joe Biden and Dr Jill Biden watch Barack Obama's farewell speech on 11 January. Obama called Biden his 'brother' Joe Biden and Barack Obama through the years US President Barack Obama speaks alongside US Vice President Joe Biden about the Affordable Care Act AFP/Getty Images Joe Biden and Barack Obama through the years Vice President Joe Biden and President Barack Obama Getty Joe Biden and Barack Obama through the years President Obama listens to Joe Biden speak of his work on defeating cancer on 18 October in the White House Reuters Joe Biden and Barack Obama through the years U.S. President Barack Obama is applauded by House Speaker Paul Ryan and Vice President Joe Biden while delivering his final State of the Union address to a joint session of Congress in Washington Reuters Joe Biden and Barack Obama through the years U.S. Vice President Joe Biden interjects as President Barack Obama delivers remarks at a reception for the 25th anniversary of the White House Initiative on Educational Excellence for Hispanics at the White House in Washington REUTERS Joe Biden and Barack Obama through the years Obama and Vice President Joe Biden react after a heckler was removed for their extended interruption (Reuters) Joe Biden and Barack Obama through the years U.S. President Barack Obama shakes hands with Speaker of the House John Boehner (R) as Vice President Joe Biden looks on Joe Biden and Barack Obama through the years Barack and Michelle Obama and Vice-President Joe Biden observing a moment of silence outside the White House to mark the 13th anniversary of the 9/11 attacks Getty Images Joe Biden and Barack Obama through the years Barack Obama and Joe Biden putt on the White House putting green Getty Joe Biden and Barack Obama through the years President Barack Obama and Joe Biden in April 2013 AFP/Getty Images Joe Biden and Barack Obama through the years January 1, 2013: U.S. President Barack Obama winks as he arrives with Vice President Joe Biden (L) in the briefing room Reuters Joe Biden and Barack Obama through the years President Barack Obama, Vice President Joe Biden and others receive an update on the mission against Osama bin Laden in the Situation Room of the White House May 1, 2011 in Washington, DC Getty Images Joe Biden and Barack Obama through the years Vice-President Joe Biden, right, confirmed that the US was looking at ways of taking legal action against Julian Assange - back in December 2010 GETTY IMAGES Joe Biden and Barack Obama through the years Joe Biden, left, and retired military officers watch President Barack Obama sign orders to close down the detention centre at Guantanamo Bay, Cuba, in January 2009 GETTY IMAGES

The former president told the audience he would not comment on the Brexit or independence referendum results but did say he believed a "strong, united Europe is a necessity for the world".

Mr Obama was presented with a kilt to mark his visit but seems unlikely to wear it, according to The Herald.

He said: "Unfortunately, I have concluded my legs are too thin to pull it off, but those (tartan) trousers I have seen you wear. I think they look pretty good. So I might try some."