It's well known that Justin Trudeau's father Pierre was Canada's 15th prime minister.

But there are governing genes on his mother Margaret's side of the family tree too: he just had to cross the Pacific Ocean to find their roots.

On Thursday afternoon in Singapore, Canada's current prime minister carved out some time during his trip to the Association of Southeast Asian Nations (ASEAN) summit to make a personal visit to Fort Canning Park, a hilltop oasis in the middle of the city-state's central business district.

In 1819, when the first British flag flew over the hill, the man who raised it over his residence — Maj.-Gen. William Farquhar — was Trudeau's great-great-great-great-great (that's five) grandfather.

The first British resident and governor — commandant, in the colonial language of the day — married a French-Malaccan woman, Antoinette Clement. (Malacca is a state in Malaysia.)

One of their daughters, Esther, eventually had a grandson named Charles who moved to Penticton, B.C. and started a family.

Two generations later, Margaret Sinclair was born. And the rest is Canadian political history.

PM Trudeau gets a quick family history lesson. His 5th great-grandfather was the first British Commandant of Singapore, William Farquhar. His daughter Esther, PMJT’s 4th grandmother on Margaret’s side, was buried here at Fort Canning Park. <a href="https://t.co/WwOQqDrDUj">pic.twitter.com/WwOQqDrDUj</a> —@janycemcgregor

Esther, Trudeau's fourth-great-grandmother, was buried in what is now Fort Canning Park.

Although the graves were moved to create the exotic park and botanical gardens on the site today, her burial stone, as well as two others from the original Farquhar family, are still on display on the grounds in front of what is now a cultural centre.

Trudeau was given a short tour of the grounds by Sharon Lim, an assistant curator for Singapore's National Museum who researched Trudeau's family history in British Columbia to sort out his Singaporean connection, and Wong Tuan Wah, the group director for the National Parks Board.

Trudeau takes a selfie for his kids as he visits the grave of Esther Bernard at the Fort Canning park in Singapore on Thursday. Trudeau's ancestor, Esther Bernard, born Farquhar (1796-1838), was the daughter of Maj.-Gen. William Farquhar (1774-1839), the first British Resident and Commandant of Singapore. (Adrian Wyld/Canadian Press)

When he reached Esther Bernard's stone, Trudeau crouched silently for a few moments as multiple camera shutters captured the moment.

Before leaving, he pulled out his phone and recorded a short message for his kids as a video souvenir of a place that's now part of their family history.

'Wouldn't exist without multiculturalism'

Trudeau had visited Singapore with his father in the '80s. But he didn't know about this family history at the time.

"This was a very touching moment for me," he said to the small group of media trailing him on his visit, "to appreciate all the criss-crossing, weaving links that make up each of our stories.

"It's just a nice moment for me to reflect on the connections and the paths that lead to Canada from the founding of Singapore."

Trudeau talks about his famous great-(x5)-grandfather's role in the founding of Singapore, and discovering his distant relatives:

Prime Minister Justin Trudeau tells students at the National University of Singapore about his nineteenth century family connection to the city. 1:21

During Trudeau's visit, he was presented with a plaque featuring a drawing from the collection originally commissioned by Farquhar to illustrate the area's natural history.

The first commandant "contributed quite a lot to this island," said Koh Poo Kiong, director of Fort Canning Park.

"Farquhar took charge of looking after the spice plantation ... subsequently it morphed into the first botanic gardens," he said.

Speaking to students at the National University of Singapore earlier in the day, Trudeau said his personal story highlighted the historical connections between Canada and Singapore — a useful calling card for a prime minister in a region where personal relationships are integral to political and diplomatic success.

"It also highlights the advantages and the reality of diversity and multiculturalism. I wouldn't exist if it wasn't for multiculturalism."

Trudeau takes a selfie with students after an armchair discussion at the National University of Singapore on Thursday. (Adrian Wyld/Canadian Press)

Trudeau told the students that Farquhar was banished from Singapore for getting too close to the locals and allowing things like gambling and other cultural traditions, which was frowned upon in the British colonial mindset of the day. He added that when his ancestor was removed, small boats filled the harbour, fondly bidding him goodbye.

Trudeau said he'd always known there was an Asian connection on his grandmother's side, but "it wasn't much talked about." Then in 2008, his mother's family history was researched for a television show about genealogy, and what they discovered "makes for a great history."

One of the audience members at the university told him he was "very good looking," eliciting loud laughter.

"It's the Singaporean blood," he replied with a smile. "It's my high cheekbones, and I tan easily."