The battle, which started on April 9, 1917, was one of the defining moments of World War I and a founding moment in Canada's history as Canadian troops fought under Canadian command for the first time.
Around 20,000 Canadians made the journey to their country's memorial in northern France to mark the centenary, turning the former battlefield into a sea of the red and white of their country's flag.
Speaking from the towering white structure, Trudeau spoke of the 3,598 Canadians — “most were men in their early twenties” — who were killed fighting to take control of the strategic eight-kilometre (five-mile) ridge.
Trudeau said one of the 80,000 Canadians in the battle, 20-year-old William Bell, had written home on April 7, 1917 to praise the cake his family had sent to the trenches. Within days, he was killed fighting at Vimy.
“It was through their sacrifice that Canada became an independent signatory of the Treaty of Versailles,” Trudeau said, referring to the most important of the treaties that brought World War I to an end.
“So in that way, Canada was born here.”
Trudeau was joined at the memorial by French President Francois Hollande and Britain's Prince Charles and his sons Princes William and Harry.
Charles, the heir to the throne, said the Canadians succeeded where other armies had failed in seizing the high ground at Vimy.
“However, victory came at an unbearably heavy cost. This was, and remains, the single bloodiest day in Canadian military history,” he said.
“Yet Canadians displayed a strength of character and commitment to one another that is still evident today… This was Canada at its best — the Canadians at Vimy embodied the 'True North, Strong and Free.'”
Prince William and his brother Harry laid boots on the memorial in memory of the fallen soldiers.
Hollande said the links built between France and Canada were evident today “when we condemn chemical massacres committed by a criminal regime” — a clear reference to the suspected chemical attack in rebel-held Syria this week.
In an apparent reference to the French presidential election — the first round takes place in two weeks' time, with far-right leader Marine Le Pen expected to reach the runoff — Hollande said those who fought at Vimy “tell us that nationalism only leads to war and that fundamentalism only leads to destruction”.
'Shaking off colonial rule'
The Battle of Vimy Ridge was part of a larger British-led offensive that included Australian soldiers, known as the Battle of Arras, which was a diversionary tactic to assist a major French attack further south.
It was the first time that four military divisions from Canada fought together as the Canadian Corps.
The crowd was the biggest for the series of centenary commemorations of World War I battles in France and five times bigger than for the commemoration of the Battle of Verdun in May last year.
Among the spectators in the bright sunshine was Ken Piggott, 54, a retired army captain from Yarmouth, Nova Scotia, who was wearing military uniform and a row of medals.
“It was an important step in shaking off British colonial rule,” he said. “For that reason, it is a huge source of pride for me.”
While many Canadians consider the victory at Vimy a significant step in their nation's development, some historians have debunked the state's official view of its significance.
Michael Boire of the Royal Military College in Kingston, Ontario, said it was “pure mythology”.
It was neither decisive for the war's outcome “nor the most fundamental” of the battles fought by Canadians during the conflict, Boire said.
“The importance given to the Battle of Vimy is a post-war mythological construction,” he said, an “invention” dating back only to 1967, the year of Canada's centennial and the battle's 50th anniversary.
But Tim Cook, of the Canadian War Museum in Ottawa, said its importance could not be underestimated.
“Many historians and writers consider the Canadian victory at Vimy a defining moment for Canada, when the country emerged from under the shadow of Britain and felt capable of greatness,” he said.