The Duke and Duchess of Cambridge have joined Prime Minister Theresa May in Belgium to mark the centenary of the start of the Battle of Passchendaele - one of the bloodiest of World War One.
Half a million Allied and German soldiers were killed, wounded or went missing in three months of fighting.
Prince William said Britain and Belgium "stand together... in remembrance of that sacrifice".
He joined the Belgian king to lay wreaths at the Menin Gate in Ypres.
The gate - which stands where British troops marched when heading to the battlefields - is covered with the names of 54,391 British dead who have no known grave, according to the Commonwealth War Graves Commission.
Officially known as the Third Battle of Ypres, Passchendaele was fought between 31 July and 6 November 1917 in the West Flanders region of northern Belgium.
About 275,000 Allied troops and 220,000 Germans were killed, wounded or went missing.
On Monday, the duke and duchess, Prince Charles and Theresa May will attend a service and lay wreaths at Tyne Cot cemetery near Ypres where thousands of soldiers are buried.
During Sunday's commemorations, attended by 200 descendents of those who fought, Prince William said: "Members of our families; our regiments; our nations; all sacrificed everything for the lives we live today.
"During the First World War Britain and Belgium stood shoulder to shoulder. One hundred years on, we still stand together, gathering as so many do every night, in remembrance of that sacrifice."
King Philippe of Belgium added that both countries would continue to honour the soldiers' "immense sacrifice".
The service ended with the Last Post, which has been played at the gate by a bugler almost every evening since 1928.
Thousands of paper poppies were also dropped from the roof of the gate to represent every name engraved there.
At the scene: 'A sense of quiet contemplation'
By Kate Palmer, BBC News, in Ypres
The lonely, eerie sound of a bugle is one that locals in Ypres are well used to.
But for the thousands of Britons gathered around Menin Gate - a memorial of white stone - it may be the first time they have heard a melody that has sounded almost every night for 90 years.
Standing by the vast stone arch were British and Belgian royals, but also many relatives of soldiers who fought in the battle.
Robert Lloyd-Rees, 75, says it is 60 years since he heard the Last Post, having first visited Ypres with his father Tom, who served at Passchendaele in 1917. He says the service is "tearful".
Father and son Phil and Luke were also outside the gate to remember their relative - Sgt Herbert Seeley - who was injured four times but sent back to the front. "Goosebumps," says Phil.
A short walk away, Ypres' medieval Cloth Hall, which was rebuilt from ruins after the war, has been illuminated. There is a sense of excitement in the city, as well as quiet contemplation.
Dignitaries and the relatives of those who died also gathered in Ypres's Market Square for an event to tell the story of the battle.
There were a number of musical and spoken performances - including from the National Youth Choir of Scotland and Dame Helen Mirren, and of a specially written piece by War Horse author Michael Morpurgo. All of them were set to a backdrop of light projections on to the historic Cloth Hall.
Journalist Ian Hislop introduced a sketch from his First World War play The Wipers Times.
And testimonies from Allied and German soldiers were also projected on to the side of the imposing Cloth Hall, including a video of Harry Patch - known as the "Last Tommy" - who fought at Passchendaele and died aged 111 in 2009.
Passchendaele became infamous not only for the scale of casualties, but also for the mud.
Constant shelling before the attack began had churned the soil and smashed drainage systems. Within a few days, the heaviest rain for 30 years had turned the soil into a quagmire.
The thick mud clogged up rifles and immobilised tanks, eventually becoming so deep that men and horses drowned in it.
On 16 August the attack was resumed, but to little effect. This stalemate continued and further attacks in October failed to make much progress. The eventual capture of what little remained of Passchendaele village by British and Canadian forces on 6 November led to the offensive being called off.
On Monday, the anniversary of the start of the battle, commemorations will continue with a special service held at Tyne Cot cemetery, where thousands are buried and commemorated.
More than 4,000 descendants and relatives of those who fought have won tickets to the event in a ballot run by the government.
Prime Minister Theresa May and the Duke and Duchess of Cambridge will also be at the ceremony at Tyne Cot cemetery near Ypres.
They will lay wreaths at the site of 11,000 graves of Commonwealth soldiers.
During the service, military personnel and descendants will read out letters and diaries from soldiers who fought at Passchendaele.