His first official visit to Scotland as Prime Minister was meticulously planned in advance of his meeting with First Minister Alex Salmond.
Arrangements had been made for Mr Cameron’s green Jaguar car to deliver him at the Queensberry House entrance off Edinburgh’s Royal Mile.
But an eleventh-hour change swung into place after noisy crowds of protestors gathered in wait.
None the less, the new PM shrugged off the demo, and laughed: “I’m making friends everywhere.”
Extra police officers had been drafted in at the parliament when anti-Tory activists gathered outside.
Most were spewing anti Tory messages protesting about the coalition with the Lib Dems.
One read: “Not Our PM”.
One security source said: “As soon as we heard there were protesters we opted to chance the arrival and departure plans.
“Flags and banners can easily be used as weapons and become a security risk, so it was a no-brainer to opt for the back door.”
Inside he met pupils from Glasgow’s Toryglen Primary School, along with their constituency Labour MSP James Kelly.
A police escort made the main journey to a meeting with Mr Salmond at St Andrew’s House a smooth one.
Emerging from the talks after an hour, Mr Cameron glanced over towards a handful of noisy teenage protesters before smiling for the assembled press photographers.
Scottish Labour leader Iain Gray said he understood why protesters were keen to make their voices heard.
He said: “I’m not surprised that there’s a lot of anger and concern about the fact that we’ve got a Tory Prime Minister.
“It is an opportunity to express to him some of the concerns that a million Scots had last week when they voted Labour.
“I think that a government that has a majority in the House of Commons has a mandate, but it’s clear that who speaks for Scotland is Scottish Labour and that’s why a million people voted for them last week.”