Barack Obama arrived in Scotland for his first ever visit and a round of golf at St Andrews before a charity dinner in Edinburgh that could hardly strike a more contrasting note with his successor.

Though officially on a private visit to Europe, the former US president risks upstaging Donald Trump, who made an awkward first impression with Nato leaders in Brussels on Thursday and had a visibly chilly first meeting with the pope in Rome.

By contrast, Obama was warmly received by the German chancellor, Angela Merkel, during an earlier visit to Berlin on Thursday and then landed in Scotland on Friday amid the sort of excitement normally reserved for current world leaders.

The truncated four-car motorcade that picked up a casually-dressed former president from a private airport outside Edinburgh served as a rare reminder that, despite the tight security, this is no longer a serving head of state.

Obama’s office insist the long-scheduled trip is a strictly private affair whose timing is coincidental to Trump’s first overseas visit and will not be open to the media. Nonetheless, many camera phones were present to witness the famously golf-obsessed president complete his homage to St Andrews and tee off to a round of applause.

Before he teed off on the third the former president’s caddy reassured him that there was “no pressure, sir”. Obama, who was hitting last, said: “Well, going by those shots I shouldn’t feel any pressure.”

After his shot, he said: “Oh, that wasn’t so pretty.”

Barack Obama speaks to Sir Tom Hunter (right) as they prepare to tee off at the first hole at St Andrews golf club, near Dundee. Photograph: Andrew Milligan/PA

After the third hole, Obama wandered over to the crowd who had been following him round the course. He shook hands with people and spoke with them before heading back to resume play.

On Friday evening, he is due to speak at a charity dinner organised by Scottish businessman and philanthropist Sir Tom Hunter to help raise money for local youth charities.

Business leaders and celebrities will be entertained by music from Annie Lennox and Texas as well as hearing expected remarks from Obama.

“From the south side of Chicago to the White House has been an epic, historic journey and it will be a true honour to hear that story from the man who made that journey,” said Hunter when he announced the event.

Earlier in the week, first minister Nicola Sturgeon had warned that the dinner at the Edinburgh International Conference Centre might have to be reviewed as a result of security precautions after the Manchester bombing.

On Thursday in Berlin, Obama paid tribute to the victims of the attack, saying he was “heartbroken by this extraordinary tragedy”.

“It is unimaginable to think about the cruelty and the violence the city of Manchester has suffered,” he added in a video message recorded with the archbishop of Canterbury, Justin Welby.

“What I also want to emphasise though is through faith and resolve the character of the people of Manchester has shown itself with the kindness and the ways in which you were assisting each other. And just know that the entire world is in solidarity with you right now.”

Obama met Merkel and Welby in front of a large crowd at the iconic Brandenburg Gate – part of a regular festival organised by the German Protestant church.

The former president heads next to Ireland before flying home but will not be meeting Theresa May, who is at the G7 in Sicily before resuming campaigning for next month’s general election.

Post-referendum relations with the British government have been strained since Obama openly campaigned alongside David Cameron against leaving the EU.