Lee and Drilona Perry got married at Newark register office late on Saturday afternoon.
They headed to the adjacent Newark Castle after to take photos but, in the meantime, register office staff went home and the gates were locked.
They were rescued along with their 50 guests after an hour and the council has now apologised.
Mr Perry, from Newark, Nottinghamshire, said he thought it was a joke at first.
"You plan a nice, beautiful wedding that you expect to be the most wonderful day of your life....only to find you get locked in," he said.
"As it started to get dark and the rain started to come down we thought let's wrap this up and get to the function, but the gates were locked."
He said they had been given no explanation as to how it had happened but "it will be a wedding to remember".
"We can laugh about it now. It could've been a lot worse," added Mr Perry.
Jeanette Hall, registration area manager at Nottinghamshire County Council, said they appreciated it "must have been frustrating for all involved".
She said: "Newark and Sherwood District Council lock these gates at around dusk and unfortunately we should have alerted the couple to the possibility that the gates may be locked when they went into the grounds."
She said they were trying to contact the couple to investigate what happened.

William Lauder, 48, of Buccleuch Street, Hawick, was found guilty after trial in April of stealing jeans, jackets and other items.
He took the goods from Aero Leather Clothing Ltd in Galashiels, Hawick and elsewhere between 2004 and 2013.
Sheriff Alistair Noble jailed him at Edinburgh Sheriff Court.
"You were held in high esteem and trusted completely and you betrayed that trust," he told Lauder.
Defence advocate, Victoria Dow, told Sheriff Noble that her client continued to deny the allegations against him.
He lived in Hawick with his wife and son and she said the financing of their home "could be compromised by any element of custody".
Lauder, she added, had no previous convictions and was assessed as being at low risk of re-offending, adding: "Therefore he is suitable for a community-based disposal.
"He is fit, able and capable of carrying out such a disposal."
A large amount of the materials taken had been recovered, she told the sheriff.
However, the sheriff told Lauder: "You were convicted of stealing just under £195,000 of property from a company of which you were the managing director.
"In part, this may have been you felt you were being insufficiently rewarded for the work you were doing for the company.
"You had been in substantial control of the company and it is clear you were held in high esteem and trusted completely. You betrayed that trust."
Sheriff Noble acknowledged that a substantial amount of the property had been recovered.
He said: "Despite these factors, it is clear in my view the offences can only be dealt with by a custodial sentence.
"Giving you as much credit as I can, you are sentenced to 21 months imprisonment from today."

Police found the man in Blackshots Lane, Grays, at about 00:35 BST. The 24-year-old from Stanford-Le-Hope had been stabbed in the chest.
Officers had been called to reports of men fighting, Essex Police have confirmed.
Two men, aged 22 and 21, have been arrested on suspicion of murder.
Police said the three injured men are being treated at Basildon Hospital with stomach and chest wounds.
It is believed the incident is related to another in nearby Chafford Hundred.
In that incident, an 18-year-old was knocked unconscious on Fleming Road at about 01:55 BST.
He was taken to hospital for treatment and later arrested on suspicion of murder in connection with the killing in Grays, police said.
A newly-wed couple had an eventful start to their marriage when they found themselves locked in a castle grounds.
[NEXT_CONCEPT]
A managing director of a Borders clothing firm has been jailed for 21 months after stealing goods worth nearly £195,000 from the business.
[NEXT_CONCEPT]
A man was stabbed to death and three others suffered "life-threatening injuries" during a disturbance in Essex.