Madonna joked that she "almost died" to get all six of her children "together in one room".
"The fact that I'm here is a miracle," she said during the concert at Barclays Center, Brooklyn, as the crowd erupted in cheers. The singer said she woke up in the hospital with her children "scared" about her condition.
In June, Madonna was hospitalized due to a bacterial infection and the condition was worsened by intensive rehearsals before the start of her tour , "The Celebration".
Madonna noted that she immediately thought of her mother, who died of breast cancer at the age of 30. "She was alone. And I was thinking, 'What if I leave my children?' That would destroy me, to leave my children at this point in their lives."
"I wasn't thinking about myself. I was thinking about them and I was thinking about my mother and how scared she must have been when she knew she was going to leave us all behind."
The singer added that "crazy things happen to us" in order to "make us understand what other people go through".
Madonna has a daughter, Lourdes Leon, with Carlos Leon and a son, Rocco Ritchie, with director Guy Ritchie. She is also the mother of four adopted children - David Banda, Chifundo "Mercy" James and twins Stella and Esther.