Canadian Prime Minister Justin Trudeau met the Queen at the Palace of Holyroodhouse on Wednesday. AP Justin Trudeau continued his joke-cracking tour of Scotland on Wednesday when he met the Queen at the Palace of Holyroodhouse.

The Canadian Prime Minister is in the UK as part of celebrations linked to the 150th anniversary of Canada becoming a single country.

He was in Scotland to receive an honorary degree from the University of Edinburgh on Wednesday in which he praised Scotland for being a "strong partner to Canada," according to The Independent.

He had a private meeting with the Queen at Holyroodhouse later the same day, set up to "honour her importance to Canada's history and to thank her for her continued dedication to Canada."

Her Majesty the Queen and Canadian Prime Minister Justin Trudeau. AP

During the meeting, Trudeau was filmed saying: "I've been offered an honorary degree at the University of Edinburgh. It probably dismays a number of my former professors to see a doctor now — even an honorary [one]".

The comment reportedly made Her Majesty crack a smile.

Canadian Prime Minister Justin Trudeau accepts an honourary degree from the University of Edinburgh. University of Edinburgh

The joke came after the Prime Minister accepted the "honoris causa" qualification at the graduation ceremony for the Scottish university's School of Social and Political Science, dressed in full academic gear. He gave a speech in which he put on a very convincing Scottish accent, mimicking his great-grandfather who apparently decided to move the family from rural Banffshire, Scotland to British Columbia, Canada, so he could fish freely.

He is the second Canadian Prime Minister to receive an honorary degree from the university, after Sir Wilfrid Laurier also received the qualification in 1902.

While accepting the degree, he said: "From the people of Canada to the people of Scotland, thank you for being a strong partner to us in this new global era of so many challenges."

"Fifteen per cent of Canadians have Scottish roots, so Canadians, including me, have a strong link and affinity with Scots."

Former Canadian Prime Minister Pierre Trudeau meets Her Majesty the Queen. AP

Trudeau previously met the Queen in London in 2015, shortly after he was elected. According to the Independent, they also met when he was a young boy and his father Pierre was Canada's Prime Minister.

During his European charm offensive in 2015, he toasted the Queen at the Commonwealth Heads of Government dinner in Malta, pointing out that he was the 12th Canadian Prime Minister to serve during Queen Elizabeth's reign.

Justin Trudeau toasts the Queen at the Commonwealth Heads of Government dinner in Malta in 2015. AP

In response, the Queen reportedly laughed and made her own toast stating: "Thank you, Mr prime minister of Canada, for making me feel so old," a comment that was also tweeted by the Royal Family.

Before his stop in Scotland, Trudeau and his wife Sophie Gregoire visited Ireland, along with their son Hadrien. Now, the Canadian Prime Minister is set to head to Hamburg, Germany for the G20 summit on July 7 and 8.