The singer reveals details about a horrific sexual assault she endured when she moved to New York City.

For the first time in her decades-long career, Madonna revealed in the November issue of Harper's Bazaar details about how she was raped at knifepoint shortly after she moved to New York City in 1978.

More From Marie Claire

In the candid personal essay, Madonna writes that the Big Apple did not welcome her nicely. "New York wasn't everything I thought it would be," she writes. "It did not welcome me with open arms. The first year, I was held up at gunpoint. Raped on the roof of a building I was dragged up to with a knife in my back, and had my apartment broken into three times. I don't know why; I had nothing of value after they took my radio the first time."

The sexual assault, which was written about in a 2007 biography on the singer, was a pivotal moment in her life and a source of inspiration throughout her career. In the essay, Madonna further describes how difficult life was for her during those early years in New York City. "I was defiant. Hell-bent on surviving. On making it. But it was hard and it was lonely, and I had to dare myself every day to keep going," she writes, before admitting that sometimes she would suffer from feeling powerless. "Sometimes I would play the victim and cry in my shoe box of a bedroom with a window that faced a wall, watching the pigeons shit on my windowsill. And I wondered if it was all worth it, but then I would pull myself together and look at a postcard of Frida Kahlo taped to my wall, and the sight of her mustache consoled me. Because she was an artist who didn't care what people thought. I admired her. She was daring. People gave her a hard time. Life gave her a hard time. If she could do it, then so could I."