Canada's long-anticipated 150th birthday celebrations were marked by heavy rains and some protests, though the downpour failed to dampen spirits of revellers who thronged in large numbers to enjoy musical performances and parades.

Prime Minister Justin Trudeau kicked off celebrations amid heavy security and some 25,000 people assembled at a large outdoor celebration in front of the national Parliament in Ottawa, where U2 topped the billing.

"When others build walls, you open doors; when others divide, your arms are open wide; where you lead, others follow," Bono said. But the bad weather meant a fly-past featuring Canadian warplanes was cancelled and later on, an evening concert was delayed by an hour to allow the rain storms to pass.

The long-anticipated Canada Day festivities, which included other features such as acrobats, and special citizenship ceremonies across large cities, concluded with fireworks.

Mr Trudeau, accompanied by Britain's Prince Charles, shook hands with some of the thousands of revellers who converged on Canada's capital Ottawa.

"Canada is a country made strong not in spite of our differences but because of them," he told the gathering.

"We don't aspire to be a melting pot indeed, we know true strength and resilience flows through Canadian diversity."

President Trudeau said true strength and resilience flows through Canadian diversity

Still, in the run-up to the celebrations, some controversy was stirred at home, particularly among First Nations who noted Canada's history of mistreatment of indigenous people.

About 100 indigenous protesters marched through Toronto, carrying red flags and with some holding the Canadian national flag upside down.

Some cities celebrated in more unusual ways. Toronto, Canada's largest city, featured a giant rubber duck floating in its harbour. The yellow duck, which cost €200,000 including the rent, drew criticism from some who described it as a waste of taxpayer money.

Calgary planned a "living flag" composed of people wearing red and white.

Security was already ramped up in the days ahead of the celebration and partygoers contended with road closures and concrete barriers across entrances into Parliament Hill, located in downtown Ottawa.

Heavy downpours prompted Ottawa firefighters to pump water off the grounds on Parliament Hill and the Ottawa Fire Service urged citizens to follow safety instructions.

National and local police were also out in force, with security a concern for many Canadians in the wake of fatal attacks in London, Paris and Germany.

Yesterday marked the 150th anniversary of the day Canada officially became a country. Britain had ruled it before 1867.

"Canada 150 years ago was a project, it was an idea to bring together four colonies with very different historical backgrounds," said Pierre Anctil, history professor at the University of Ottawa.

"We should celebrate but we should not be complacent. It's not a finished project," he added.

"As a society, we must acknowledge and apologise for past wrongs, and chart a path forward for the next 150 years," Mr Trudeau said in a statement ahead of the official kickoff.

Indigenous rights group Idle No More had called for a national day of action, telling supporters to hold rallies and take to social media.

Events and installations celebrating the sesquicentennial milestone have already been held across the country this year, with the total cost to the federal government reported to be CAN$500m.

Along with fireworks, free museums and outdoor concerts nationwide, more than 50 special ceremonies to swear in new citizens were planned across the country.

Twitter users were sharing their favourite Canadian songs and food, along with photos of the preparations under the hashtag Canada150.

Prince Charles and his wife Camilla arrived for an official visit last Thursday. The royals began a three-day tour with a trip to the northern territory of Nunavut, home to a large number of First Nations and Inuit people.

The celebrations in Ottawa culminated with a musical fireworks show that was billed as largest-ever such display for Canada Day. It lasted 20 minutes and 17 seconds to commemorate 2017.

"One hundred fifty years? Nah. Look at us: Canada is being born today," Mr Trudeau told the crowd.