A woman lost in South Australian bushland for three days was rescued thanks to an “SOS” she scrawled in the sand in front of a security camera, police said.

Deborah Pilgrim, 55, was camping with friends Sunday, when, after a party, she decided to go for an early morning walk near the town of Sedan — and never returned.

Rescuers used a helicopter, drones and volunteers to scour the area, fearing for Pilgrim’s safety in the Outback, which is packed with harsh scrubs and poisonous snakes.

Search crews were planning on trying for one more day, when retired police officer Neil Marriott called Wednesday to say CCTV cameras at his property had caught something unusual.

“There was the SOS written on the ground, which wasn’t there the day before,” he told the Australian Broadcasting Corporation.

“So I put two and two together and called police… they found the SOS on the ground but then they also found a hoodie jacket which obviously belonged to the lady.”

Police found Pilgrim in an empty building near Marriott’s property. She was about four miles from where she was reported missing — dehydrated but otherwise in good health.

When she was found, Pilgrim was “hollering and yelling and being very happy the police had actually arrived,” Superintendent James Blandford said at a news conference.

In an interview with the ABC, Pilgrim said she just “tried to stay out of the sun and stay alive.”

“I just knew that it was my job to stay alive,” she said.

She worried her friends and partner would think she’d been kidnapped. She kept wandering, trying abandoned vacation homes, and leaving a trail of her belongings.

“I was numb the whole time — I did not feel hungry, I was just terrified,” she said.

Eventually, she made Marriott’s property her base, because she had access to clean water from a tank there, and also managed to find a can of soup.

“My thoughts would go back to my partner and my mum, I knew she wouldn’t be able to handle this, that kept me going,” she said.

To survive, she’d give herself pep talks saying, “keep going, you can do this, stay alive, people need you, keep going, get out of here,” she recalled.

She thanked Marriott for helping in her rescue.

“I’m only going to walk in my own area from this day forth,” she vowed. “No more pilgrimages.”