VANCOUVER -- Prime Minister Justin Trudeau extolled on the importance of unity as he marched in Vancouver's annual Pride parade with two of his political rivals on Sunday.

The prime minister took the opportunity to offer his condolences to the victims of two mass shootings that left a combined 29 people dead in Texas and Ohio over the weekend, before he joined NDP Leader Jagmeet Singh and Green Leader Elizabeth May on the parade route.

"It's so important that we all stand together in moments like this," Trudeau told reporters. "We're standing up for human rights, standing up for communities who are marginalized."

He, Singh and May walked side-by-side for several blocks near the beginning of the parade, surrounded by crowds decked out in rainbow-hued beads and glitter. Trudeau was also joined by his wife, Sophie Gregoire Trudeau, and their children.

But despite the talk of unity, the prime minister used the opportunity Sunday to take jabs at Conservative Leader Andrew Scheer, widely regarded as his top challenger in October's federal election.

"It's just unfortunate that there are still some party leaders who want to be prime minister, who choose to stand with people who are intolerant instead of standing with the LGBT community," he said.

"I really wish Andrew Scheer were here today to pass that message to kids in rural areas who might be suffering bullying, suffering challenges, that we support them right across the board, but I'm here with politicians who do."

Scheer has so far been absent from the country's Pride parades, and a spokesperson previously said he didn't have plans to join any.

And while Scheer's press secretary Daniel Schow did not acknowledge the leader's absence Sunday, he defended his party's track record on human rights.

"Canada's Conservatives have a proud history of fighting for the rights and protection of all Canadians, including those in the LGBTQ community, at home and abroad," Schow wrote. "There are many ways to support these communities, and it is vital that the rights all Canadians are protected regardless of race, gender or sexual preference."

But May and Singh both echoed Trudeau's concerns about Scheer's absence, with the former saying that Pride celebrations are an expression of some of Canada's core values: empathy and inclusion.

"The Conservatives weren't there. Their complete boycott of Pride parades is disturbing. But I want to concentrate on the positive," May said. "This is not about partisanship. This is about who we are as a country."

Singh added that when leaders march together at Pride, it's a show of solidarity with Canada's queer community.

"But we need to go beyond that to make sure policies also celebrate people," he added, pointing to restrictions on blood donations from men who have sex with other men.

The NDP have also promised a national action plan to ban so-called conversion therapy for minors in Canada, according to a statement from Singh on the day of the parade.

Later on Sunday evening, Trudeau was expected to address supporters at a Liberal fundraiser in Surrey, B.C., that required a $500 donation to attend.