Paris: Britain’s royal family heads to the First World War battlefields in northern France on Thursday to mark the 100th anniversary of one of history’s bloodiest clashes, the Battle of the Somme.

Beleaguered British Prime Minister David Cameron — mired in a battlefield of his own after Britain voted to leave the European Union — confirmed he would attend the ceremony.

French President Francois Hollande made a last-minute change to his schedule to attend and show that “beyond what is happening at a European level, the United Kingdom remains a friend with which France wants to keep a relationship,” a source close to the president told AFP.

Initially, Prime Minister Manuel Valls had been put down as the highest-level representative of the French government.

Prince Charles, Prince William and his wife Kate as well as Prince Harry will also attend the ceremony as the two countries recall their joint offensive against Germany that became one of the defining events of the First World War.

The 141-day battle left more than a million dead, captured or missing, with some 20,000 British forces — including soldiers from around the Commonwealth — dying on the first day, while thousands more were maimed and wounded.

The battle was launched on July 1 as Allied forces hoped to relieve the pressure on the French, who were racking up losses in Verdun by attacking the Germans further north at the Somme.

However, British troops who went over the top of their trenches on the first day were mowed down by the Germans, a scenario that would be repeated as tens of thousands died for every mile gained — a total of five for the Allies when it ended.

The battle turned into a long war of attrition and came to symbolise the horrors of trench warfare and the futility of the war.

On the Allied side, the battle was seen as a military tragedy not only for the British, but also for their comrades in arms from Ireland, South Africa, New Zealand, Australia and Canada.

Germany for its part suffered around half a million casualties.

Some 20,000 people are expected to attend the various ceremonies in the Picardy region at six different memorials, according to local authorities.

A nightlong vigil to be attended by members of the British royal family will take place on Thursday, before the main commemoration event on Friday.

Some 850 police have been deployed to secure the events, with large parts of the region to be completely blocked to traffic while they are under way.