Rescuers in North Carolina found the bodies of a 5-year-old girl and her 4-year-old brother who had been swept away by floodwaters, bringing an end to a dayslong search, authorities said Thursday.

“We were hoping a for a better outcome,” Johnston County Sheriff Steve Bizzell said Thursday. “But at least this morning, we have retrieved them. The family has been notified, and we want to keep the family in our thoughts and our prayers.”

The children, Alexa Castro, and Abraham Martinez, Jr., were with their mother, Vanessa Castro, in a car when flash floods struck Smithfield in Johnston County, about 30 miles south of Raleigh, on Monday night.

First responders were able initially to reach both the mother and Abraham Jr., but the boy slipped away when a rescue boat capsized, officials said.

Alexa’s body was found on Wednesday afternoon and Abraham’s on Thursday morning, according to the sheriff.

“Everybody that I’ve talked to has been in continuous prayer for this family and these kids and their safety — and we have found them,” Bizzell told reporters.

The children’s bodies were discovered in a shallow creek that feeds into the Neuse River, and Bizzell said that if they had been carried away by the river’s fast-moving waters, their bodies might never have been found.

“I’m just thankful that they never got into the Neuse River,” Bizzell said.

“It’s a sad day for for the family, it’s a sad day for law enforcement, it’s a sad day for the first responders, the searchers, the boaters,” he said. “But at least we got those children, and the family can find a sense of closure. Those kids are in a better place than we are today.”