The woman, who was alone in her apartment at the time, responded to the call of nature at around 6am – but instead ended up stuck in her bathroom after the lock jammed.
She tried banging on the wall in the hope that one of the other people living in the housing block in Finspång, central Sweden, would hear and raise the alarm.
However, hours passed and a neighbour, eventually finding the noise suspicious, called the police at 8.30pm – some 15 hours after the woman first found herself trapped.
With the help of a master key to the building officers were able to get the toilet door open.
"She thought it was about time that she got out, because she had been sitting there since six o'clock banging. It was perhaps a slightly longer toilet visit than she had expected," police press spokesperson Fredrik Kliman told public broadcaster SVT.
The woman, who was relieved to be let out, is understood to have suffered no longlasting injuries in the incident, which took place on Wednesday but was only reported by Swedish media on Friday.