Justin Trudeau says all of Canada shares in Calgary's grief as the city mourns the loss of five-year-old Taliyah Marsman, whose body was discovered Thursday night, three days after her mother Sara Baillie was found dead.

"She was a beautiful child, as are all children, with a full and promising life ahead of her," Trudeau said Friday.

"I want Calgarians to know that the entire country is with you in grieving her loss and that of her mother, Sara."

"To the family and friends of Sara and Taliyah, I am so deeply sorry for the loss of two people whom you loved and loved you," the prime minister went on to say.

"Families across this country — parents, aunts, uncles, grandparents, siblings — are grieving alongside you, thinking of you, praying for you. I hope you can someday find some peace through your sadness."

Calgary Mayor Naheed Nenshi also extended his condolences to the families of the homicide victims, saying the "deep hurt" is felt across the city.

"These are tough times, but I think they are also times that remind us that, together, we live in community," he said.

"And the reason that we feel the pain of Taliyah and Sara's loss so deeply is because we understand that we are neighbours and we live together in this community and we are, in fact, in it together."

Trudeau attending Stampede with 'heavy heart'

Trudeau was in Calgary in part to attend the Stampede, an event to which he is no stranger, but Friday's visit marks his first as prime minister.

He flipped flapjacks and watched cowboys at the Genesis Centre Stampede Breakfast in the city's northeast before joining Alberta Premier Rachel Notley to make a funding announcement about the southwest Calgary ring road.

Trudeau tweeted earlier Friday that he would be heading to the city with a "heavy heart" after hearing that Taliyah's body was discovered late Thursday night.

Edward Downey, 46, has been charged with two counts of first-degree murder in their deaths.

Speaking at a Stampede breakfast in northeast Calgary earlier Friday, his seven-year-old daughter Ella-Grace by his side, Trudeau also addressed the deaths.

"On behalf of all Canadians, I want to express our condolences to the families and the people of Calgary for the devastating loss of Taliyah and her mom Sara," he said.

"I know there were a lot of hearts broken when the news came out and there were so many volunteers and police services involved in trying to help a terrible situation that we all need to take a moment to send our love and hearts out to Taliyah and Sara's family."

NDP Leader Tom Mulcair also offered his condolences in the case that he said has "devastated" a Calgary family, and the police officers who worked around the clock.

Trudeau also sent condolences to the people of France on behalf of all Canadians after a man drove a truck loaded with weapons into a crowd of people in Nice on Thursday, killing dozens.

"Our hearts go out to all the victims and their families. Canada stands with France as a steadfast ally and we will work with the international community to fight terror and to ensure that we live in a peaceful world."

Southwest ring road funding 

The prime minister planned to take in some rodeo events in the afternoon.

Trudeau has been attending the annual event since he was a child. His father, former prime minister Pierre Trudeau, served as parade marshal in both 1971, months before Justin was born, and 1978.

For the ring road announcement, Trudeau and Notley was joined by Calgary Mayor Naheed Nenshi and Chief Roy Whitney of the Tsuut'ina First Nation, which will partner with real-estate developer Canderel to build three business centres along the road.

The band says the multi-billion-dollar project will have a major long-term positive impact on Calgary and the First Nation.

The southwest portion of the ring road is scheduled to be completed in 2021.

With files from The Canadian Press