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.
'Wedding to remember'
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.