VIRGINIA BEACH, VA. -- A night out turned into a nightmare over the weekend in Virginia Beach.

A woman who wanted to remain anonymous says a friendly stranger attacked her and tried to sexually assault her at the Oceanfront, but she says the Emergency SOS feature on her iPhone helped save her life.

It was early Sunday around 2 a.m. and the woman was about to get into her Uber to go home when she says, “This guy came up to me and said, ‘I lost my phone... can you help me find my phone?'"

The simple gesture for help that was the bait.

“I wasn’t suspecting he was bad. He was a very normal, nice looking guy,” she says.

She says the man lured her back to boardwalk to find a lost phone and she just wanted to help.

“I was like, 'Where are your friends? Why are you alone?' He was like, ‘I’m in the military. I’m not from here,' and my brother is in the military—I felt bad for him.”

It was a believable story from someone who didn’t appear threatening.

He eventually tells her he might have lost it in the sand. She let him use the “Find My iPhone” app on her phone, but it wasn’t working. She got a terrible feeling when she realized he doesn’t know how to navigate her iPhone to use the app.

“I get my phone back and I turn around and I try to run away and he just comes up from behind me, tackles me, grabs my face, is covering my mouth.”

They’re struggling in the sand, and at one point he says he has a knife.

“I’m trying to scream for help, [he] tackles me to the ground - is like shoving my face to the ground - and now, because I’ve been screaming, he’s holding my mouth even tighter trying to muffle any noise I’m making,” she says.

In the middle of a fierce attack, she was poised and made a life-saving call without her attacker knowing.

She used her iPhone's Emergency SOS feature. To activate the SOS feature, she held the power and volume button down at the same time. Users can also tap the power button five times. It only works if the Emergency SOS feature is turned on in the phone’s settings.

Her iPhone automatically dialed 911— dispatch was on the line listening and sent police to her location.

“He looked up and the headlights from police were shining from the sand, and he just took off and ran down the beach and the police ran after him and they were able to get him in a foot pursuit.”

The nightmare was over.

“I’m so thankful for those police officers. I know they have a thankless job, and I just can’t thank them enough."

She says police caught her attacker and it’s all because of the simple safety feature on her phone.

“They were originally going to look in the hotels and dispatch updated them that I was talking about the water— I’m begging him not to drown, I don’t want to drown - so they knew to come look in the sand.”

Now, she just wants to warn others and help them be more prepared.

“All the cards lined up for me, but I know that doesn’t always happen and people aren’t so lucky. And if there’s anything we can do to be proactive, we should do it.”