Image copyright JIM GODBY Image caption Canadian Prime Minister Justin Trudeau took a selfie with 13-year-old Alexander Godby.

A Canadian family on holiday stumbled upon a shirtless Prime Minister Justin Trudeau while hiking in Quebec's Gatineau Park.

The Godby family spotted Mr Trudeau last week as the prime minister and his family emerged from a cave.

After some hesitation, the Godbys struck up conversation with the Trudeaus and a selfie was taken.

"It was just like, 'Wow, that's crazy! We just met the PM,'" Jim Godby of Peterborough told the Toronto Star.

The Trudeaus had been exploring the Lusk Cave, a marble cavern with a waist-high stream running through it.

The famous cave is in the centre of the vast national park, which is about 50km northwest of Ottawa.

"When you step out your front door, you never know what adventures await," Mr Godby later wrote in a Facebook post about the encounter.