No pressure Barack: The crowd look on expectantly as Obama plays the green

Obama is due to head to a charity dinner in Edinburgh tonight, where the proceeds will be split between The Obama Foundation and local charities for children

'It was a rainy day in Scotland and I was just blown away by his speech and his message of hope,' said Sir Tom. 'I just thought it would be great to have him in Scotland.

'After he left office in January we made the invitation. Former US ambassador to Britain Matthew Barzun, who I'd become friendly with, was very helpful in making the right connections.

Obama arrived at Edinburgh Airport on Friday morning before heading to the course. He later addressed business leaders and take part in a Q&A at the charity dinner organised by Sir Tom.

A crowd lined the street amid a large police presence outside the Edinburgh International Conference Centre to try and catch a glimpse of Mr Obama at the charity event but it is thought he arrived by a back entrance.

Those in attendance at the dinner included Scottish political leaders Nicola Sturgeon, Ruth Davidson and Kezia Dugdale, as well as sports star Dame Katherine Grainger, RBS boss Ross McEwan and businessman Sir Ian Wood.

Profits will be split between children's charities in Scotland and the Obama Foundation, set up by the former president and his wife Michelle.

Singer Annie Lennox, rock band Texas and comedian Kevin Bridges will provide entertainment and Mila Stricevic, 13, from Glasgow will read a poem after winning a school competition.

Even in retirement the former US president still traveled with a substantial security detail

While Donald Trump might have his own golf course, its clear which of the two most Scots would rather tee off with

Security was tight in Edinburgh as police step up resources around major events in the wake of the Manchester bombing that killed 22 people on Monday. Obama's motorcade seen here

The politician, looking casual in a shirt and sunglasses, appeared to be in great spirits as he touched down despite the security threat

Mr Obama posted a heartfelt tribute to the city of Manchester just hours ahead of his Edinburgh visit

Sir Tom's Hunter Foundation has previously arranged for US politicians and actors, including Bill Clinton, Leonardo DiCaprio and George Clooney, to come to Scotland.

Mr Obama posted a heartfelt tribute to the city of Manchester just hours ahead of his arrival in Edinburgh.

In a tweet to his 88million followers, the politician said that his 'thought and prayers' were with the people of Manchester and those affected by the blast.

Obama wrote: 'Through faith, love, and resolve the character of the people of Manchester has shown itself. Our thoughts & prayers are with you.'

The visit went ahead despite plans that it could be cancelled amid fears another terror attack is imminent.

Scotland's First Minister Nicola Sturgeon said officers were looking at whether the visit could go ahead as planned following the Manchester suicide bombing.

She said: 'Police Scotland is carrying out a review of all major events, including the one involving President Obama.

Tickets for tables of 10 at this evening's dinner quickly sold out

He carried his own bag as he deplaned from the private jet

The visit went ahead despite plans that it could be cancelled amid fears another terror attack is imminent

Auction prizes include two walk-on parts in the next Fantastic Beasts film and the naming rights to the Gleneagles Hotel American bar.

'Obviously, additional security will be provided by Police Scotland for a visit of such a nature and involving somebody in his position.

'I am not anticipating anything other than the event going ahead, but I make it very clear that the police are reviewing all these events, and that will lead to their making decisions on them.'

Other 'major events' including the Edinburgh Marathon - due to take place on Sunday - and sports matches are also being reviewed, with security dramatically tightened.