A month after announcing on Instagram that she was pregnant, the pop star Britney Spears has posted an update saying that she suffered a miscarriage, writing: “We have lost our miracle baby.”

“Perhaps we should have waited to announce until we were further along,” said the message, which was posted to Ms. Spears’s Instagram account on Saturday

afternoon and attributed to her and her partner, Sam Asghari. “However we were overly excited to share the good news.”

When Ms. Spears, 40, let it be known that she was pregnant, her announcement was seen by many not only as glad tidings,

but also as a declaration of agency after being freed from a conservatorship that had governed her life since she was in her 20s.

She described having experienced depression during a previous pregnancy, and said that this time she would be staying in more and doing yoga each day.

She ended her message by writing: “Spreading lots of joy and love,” followed by heart emojis and exclamation points.

“Our love for each other is our strength,” it added. “We will continue trying to expand our beautiful family.”