Beyonce has spoken publicly for the first time about losing her first baby two years ago.

The singer gave birth to a daughter named Blue Ivy last year, and just days afterwards, her husband Jay-Z released a song suggesting they had a previous miscarriage.

According to WENN, Beyonce confirmed they had a baby on the way two years ago. In her new documentary "Life Is But a Dream," she said, "About two years ago, I was pregnant for the first time. And I heard the heartbeat, which was the most beautiful music I ever heard in my life. I picked out names. I envisioned what my child would look like ... . I was feeling very maternal. I flew back to New York to get my check up -- and no heartbeat. Literally the week before, I went to the doctor, everything was fine, but there was no heartbeat."

The singer said she dealt with the emotions associated with her miscarriage by making music. "I went into the studio and wrote the saddest song I've ever written in my life. And it was actually the first song I wrote for my (last) album. And it was the best form of therapy for me, because it was the saddest thing I've ever been through."

Beyonce said the loss made her even more grateful when she had Blue Ivy.

"Being pregnant (with Blue Ivy) was very much like falling in love. You are so open. You are so overjoyed. There's no words that can express having a baby growing inside of you."

Contact Tony Hicks at thicks@bayareanewsgroup.com or on Facebook at www.facebook.com/BayAreaNewsGroup.TonyHicks.