His office subsequently released a statement defending his actions.
A spokesman for Mr Trudeau said: “After dinner on Saturday, the Prime Minister joined a small gathering with members of the Canadian delegation, who have come together to pay tribute to the life and service of Her Majesty.
“Gregory Charles, a renowned musician from Quebec and Order of Canada recipient, played piano in the hotel lobby, which resulted in some members of the delegation including the Prime Minister joining.”
The spokesman added: “Over the past 10 days, the Prime Minister has taken part in various activities to pay his respects for the Queen, and today, the entire delegation is taking part in the state funeral.”
Canada’s delegation to the funeral included Mr Trudeau, Mr Charles, and 16 other people, among them Mark Tewksbury, the Olympic swimmer, and actress Sandra Oh.
‘That was a lot of fun’
Mr Charles, 54, told to Canada’s Globe and Mail newspaper that the proceedings for the late Queen’s state funeral reminded him of Caribbean funerals, mixing sombre moments with others celebrating life.
He said: “Everyone sang with me for two hours. That was the feeling, that was a lot of fun.”
Mr Charles said he had not met the late Queen but had met King Charles numerous times. The first time was two decades ago when he toured Canada.
Mr Charles said the King was “very funny, very fun-loving, very good with people”.