A queue of mourners hoping to get inside the castle grounds for a 96-gun salute stretched around the castle, which stands in the heart of Wales’ capital city.
The salute was performed by the 104th Regiment Royal Artillery – with each shot representing a year of the Queen’s life.
Beginning at 1pm, the salute was timed to coincide with similar events taking place in each of the UK’s four nations, including at Hillsborough Castle in Northern Ireland, Hyde Park in London and Edinburgh Castle in Scotland, as well as in York, Portsmouth and Gibraltar.
The salute lasted around 12 minutes, and the final shot was followed by applause from members of the public.
Also in attendance were the First Minister of Wales Mark Drakeford and Cardiff Council Leader Huw Thomas.
Church bells across Wales rang between midday and 1pm, and flags remained at half mast as the nation entered a 12-day period of mourning.
Meanwhile, a two-minute silence was held for the Queen on Castle Square in Caernarfon, North Wales.
A book of condolence was opened at Cardiff City Hall at 2pm, with people encouraged to leave floral tributes outside the building.
One of the messages left with the flowers read: “Thank you for a lifetime of dedication. You will always be in our hearts.”
Another said: “Lilies for our beautiful Queen Lilibet. We will mourn you forever.”
Inside City Hall, Cardiff’s Lord Mayor, councillor Graham Hincheyâ, said: “Queen Elizabeth II dedicated her entire life to the service of this country, and has been a reassuring and steadfast presence at times of war, social and political unrest, and throughout the recent pandemic.
“Before becoming Queen in 1952 she was awarded a freeman of the city of Cardiff in 1948.
“And this city has been honoured to welcome her on many occasions during her reign, most recently to the official opening of the Senedd in October last year.
“It is with great sadness that the capital city of Wales will now join the rest of the nation in mourning the ending of a remarkable life and reign.”
Cardiff resident Kathryn Hudson, 56, said she thought it was important to mark this historic moment and pay “respect and love to the Queen”.
“My first memory was actually of my mum taking me to Cardiff Castle to see the Queen and Prince Charles when I was three in 1969 when Charles was made the Prince of Wales,” she said.
“So when I heard that there was going to be a gun salute at the castle, I decided I was going to come along and also sign the book of condolences.
“I thanked her for her strength and service. For her care and compassion. And for quietly standing up for the well being of her citizens, which is what I believe she has done over the years.”
She added: “I think it’s early days but it’s an unsettling time. We’re in turmoil in this country and I think she has always been the strength.
“I personally hope she had a quiet word on Tuesday and perhaps suggested it is important to look after the people in this country.”
On Saturday, Mr Drakeford will attend a meeting of the Accession Council as a Privy Councillor at St James’s Palace when the new King will be formally proclaimed monarch.
The following day the Senedd, Welsh Parliament, will be recalled to pay tribute to the Queen.
A motion of condolence will be broadcast to the nation at 2pm.
On the same day, September 11, King Charles III will be proclaimed King at a ceremony in Cardiff Castle at midday.
Proclamations of Charles’ succession to the throne will be held in areas throughout Wales, and in Scotland and Northern Ireland.