Thousands of spectators braved wet weather to watch a Battle of Trafalgar re-enactment off Portsmouth - the climax of bicentenary celebrations.
Fusillades of gunfire, blasts from cannons and fireworks helped mark the 1805 victory over France and Spain.
Earlier the Queen conducted a massive international fleet review.
She and Prince Philip sailed from Portsmouth on HMS Endurance to conduct the review of 167 naval, merchant and tall ships from 36 countries.
Spectators were also treated to a series of sail-pasts and air displays by the Red Arrows and vintage aircraft.
The evening's mock Napoleonic battle began when an actor playing the part of Nelson sailed from shore in a small cutter to board the tall ship the Grand Turk, a replica 19th century frigate.
The ship played the part of Nelson's historic flagship Victory during the battle.
After the re-enactment, a massive fireworks display, one of the most spectacular ever staged in the UK, was mounted over the ships.
MAJOR RECENT FLEET REVIEWS
May 1944 - before D-Day (unpublicised)
June 1953 - the Queen's coronation
May 1969 - the 20th anniversary of Nato
June 1977 - the Queen's Silver Jubilee
The fleet was then illuminated as a commentary on the famous victory boomed out over the Solent.
In the afternoon, it took about two hours for Endurance to sail up and down the lines of anchored vessels, which the Queen inspected from a specially constructed viewing platform.
As the Queen passed each vessel, she was saluted by its crew.
The vessels, including ships from the US, France, Spain, India, Japan, South Korea, Pakistan, Nigeria and South Africa, lined up at the Spithead mooring in the Solent with between 25,000 and 30,000 sailors on board.
360-degree panorama from the deck of HMS Ocean
They had been arriving in the Solent for days, along with thousands of spectator yachts.
The Queen said in a written message that the presence of such a large international fleet was a tribute to Admiral Lord Nelson - who died in the battle on 21 October 1805 - and the special bond between sailors.
"Admiral Lord Nelson's supreme qualities of seamanship, leadership with humanity, and courage in the face of danger are shared among our maritime community today. He could wish for no greater legacy," she said.
The Queen and Duke of Edinburgh were joined on the Endurance, a polar survey ship, by Defence Secretary John Reid and the Chief of the Naval Staff, Admiral Sir Alan West.
The royal couple had lunch on the ship, and received a 21-gun salute from frigate HMS Chatham at the start of the review.
Spectators' yachts and patrol ships carrying armed police, as part of a £1.7m security operation, sailed alongside Endurance.
The Prince of Wales and the Duchess of Cornwall watched the review from on board survey ship HMS Scott with other Royals travelling aboard various ships.
The Duke of York was on HMS Enterprise, and the Princess Royal on RFA Sir Bedivere. The Duchess of Gloucester watched from HMS Gloucester, and Prince and Princess Michael of Kent from RFA Fort George.
The event follows a long tradition of reviews of the fleet at the Spithead mooring, dating back to medieval times. The last was in 1977 to mark the Queen's Silver Jubilee.
After a series of further spectacles including the display by the Red Arrow, the Queen attended a reception on board HMS Invincible.
The mock Battle of Trafalgar was held between a blue and a red team, rather than Britain versus France.
The decision upset some who regarded it as unnecessary political correctness.
It is one of 17 historic ships from five countries involved in the spectacle, aimed at illustrating how sea battles were fought in the era of Nelson and Napoleon.