A mother and her two little children were rescued after she went up a roof with them and stood dangerously close to the edge.

The Delray Beach police responded to a call on Saturday of a woman and children standing on a roof. When the officers arrived on the scene, they found a 23-year-old woman with her two small children. The three were on the garage ledge on a townhouse and the children were crying out in fear.

One of the officers, Rob Addea, immediately stood under the window, so that he would be ready to catch them if they fall.

“Just get the kids back inside. Please. Please. That’s all we want you to do,” he begged the woman who is believed to have been under the influence of a substance.

Meanwhile, the other two other officers went upstairs and out a window to the ledge to attempt a rescue. One officer managed to grab the children’s arms while the other tried to reason with the woman, police said. Eventually, police were able to rescue all of them. The woman has been committed to a mental health facility under the Baker Act and might face criminal charges, police said.

The incident happened by 4 p.m. in a townhouse around Delray Beach, Florida.

“It appeared that the children would either fall or be pushed off the roof by [the woman] herself … which would have caused certain serious injury and/or death to them both,” a police report said.

The Florida Department of Children and Families is investigating and the children are in their custody.