In what surely was not part of any movie script, actress Anne Hathaway found herself in danger, as she got caught in a riptide during a vacation in Oahu, Hawaii.

It was announced on Friday that the One Day star was swimming when she suddenly started thrashing her arms and shouted, according to PageSix. Hathaway's husband, Adam Shulman, 32, was on the beach, but was apparently unable to hear her.

Fortunately, a nearby surfer noticed the 31-year-old screaming and ran into the ocean with his boogie board to rescue her where she was brought back to shore.

During her struggle, Hathaway received a cut on her foot from a reef, which her husband helped take care of. He was seen bandaging her foot and even sucking her toe. Hathaway eventually got past her ordeal and even posed for pictures with fans later that day.

Hathaway's breakthrough role was in The Princess Diaries as Mia Thermopolis opposite Julie Andrews. She went on to make more mature films, including Brokeback Mountain, Havoc and Rachel Getting Married, where she earned herself an Academy Award nomination. She didn't win that one, but she ended up nabbing an Oscar four years later for her role as Fantine in the infamous musical Les Miserables.

Her next film will be Song One, where she'll play an archaeologist who returns home after finding out her brother was in an accident. This leads Hathaway's character to find her brother's favorite musician, who she ends up getting into a deep relationship with.

Song One is set to hit theaters on Jan. 20. Hathaway will also reprise her animated role as Jewel in Rio 2, which will be in theaters on Apr. 11.