The Queen has ended a day of events to mark the 200th anniversary of the Battle of Trafalgar with a dinner on board HMS Victory in Portsmouth.
The Queen lit the national beacon at HMS Victory
The Queen and the Duke dined with senior Royal Navy officers in the great cabin of Lord Nelson's flagship.
The Queen also lit the first of a 1,000 beacons to form a "chain of light" around Britain.
Beacons were also lit by the Queen's four children in Scotland, Wales, Northern Ireland and at Greenwich.
In the Scottish village of Ballater, near Balmoral, the Prince of Wales set the next fire alight, accompanied by a lone piper playing the First Lament.
The Princess Royal lit the third beacon at HMS Cambria, the Royal Naval Reserve base at Sully, near Barry.
The Earl of Wessex lit the fourth on the battlements at Killyleagh Castle, Northern Ireland.
And the Duke of York lit a beacon at Greenwich, south-east London, where Nelson's body lay in state following his death at Trafalgar.
The Queen sent a flame 30ft into the air as she lit the national beacon at HMS Victory shortly before 1900 BST on Friday.
It was mounted on a base featuring the prayer Nelson wrote before the 1805 battle - seen as ending Napoleon's plans to invade Britain and establishing British supremacy at sea.
In the battle, the Royal Navy beat a combined French and Spanish fleet, but Nelson was killed by a French sniper.
The Queen, who is Lord High Admiral of the Fleet, was joined by 24 guests on HMS Victory.
She said she was delighted to be aboard Lord Nelson's flagship to mark his "famous victory at Trafalgar 200 years ago".
"The defeat of the combined French and Spanish fleets lifted a very real threat of an invasion of Britain," she added.
"It was greeted by the nation with huge relief, and it was the first step in the process of defeating Napoleon's ambitious plans for the domination of Europe.
"Success at Trafalgar was by no means a foregone conclusion.
"The British fleet under the command of Lord Nelson faced a formidable enemy - but battle was seldom decided by statistics.
"It was the qualities of the leadership and comradeship he gave to the Royal Navy in the years leading up to his final battle that made all the difference.
"He was without doubt a superb tactician and a fearless and determined commander - but he was above all a man of faith, duty and deep concern for the welfare of everyone in his fleet."
Earlier in the day, Britain's most senior sailors laid wreaths at Nelson's tomb at St Paul's Cathedral and on the Victory.
French and UK representatives attended religious services and a military parade in Cadiz, near to the site of the battle off southern Spain.
More than 6,000 events are planned across Britain over the weekend, culminating with a parade in London's Trafalgar Square before church bells peal throughout the UK to commemorate those who died in maritime conflict.