Wootton Bassett given Royal prefix by the Princess Royal
Wootton Bassett has been officially renamed with the prefix "Royal" in a ceremony in the Wiltshire town.
Thousands of people gathered for the ceremony, during which the Princess Royal presented the Letters Patent on behalf of the Queen.
The move recognises the role the town played during the repatriation of UK military personnel killed in war.
The event was attended by David Cameron and the new Defence Secretary Philip Hammond.
It is the first time since 1909 that a town has been granted a royal title.
At the start of the ceremony, former mayor of Wootton Bassett Steve Bucknell led a minute's silence to remember service personnel who have been killed.
Speaking at the ceremony Princess Anne paid tribute to the residents and said the community had come together in a most extraordinary way.
"I am privileged to be allowed to add my thanks to those of Her Majesty the Queen and the whole country for the example you set in responding with dignity and respect to the losses that this country, operational responsibilities have forced upon us," she said.
Earlier the princess was received by the Lord Lieutenant, John Bush, before touring an exhibition in the town's library and watching a parade through the town's High Street.
Wootton Bassett gained fame as its residents stood quietly showing respect for fallen servicemen whose bodies were driven through the town.
The decision to rename it Royal Wootton Bassett was taken by the Queen following a petition from the prime minister.
Mr Cameron stood alongside Mr Hammond, who was attending in his first official engagement since taking over the role from Liam Fox on Friday.
Also there was the Chief of the General Staff, Sir Peter Wall.
The Band of Her Majesty's Royal Marines, Collingwood, were marching to a piece of music entitled Wootton Bassett, written by Capt Pete Curtis, a Royal Marines director of music.
Flypasts of a C-17 Globemaster and a C130 Hercules took place over the town. A Vulcan bomber was also due to fly over.
A peal of bells, especially written for the occasion, was sounded at the town's church of St Bartholemew.
The first repatriation service took place in Wootton Bassett in April 2007 when the bodies of military personnel began arriving at the nearby RAF base at Lyneham.
Since then thousands of people have turned out to pay their respects to servicemen killed in conflicts in Iraq and Afghanistan.
The last cortege passed through the town in August, after which RAF Brize Norton in Oxfordshire became the landing site for planes returning from conflict zones.
The last town to be given royal status was Tunbridge Wells in Kent, in 1909.