Caught in rough surf far from shore, stranded swimmers might hope for a lifeguard to appear amid the waves.

But for two men recently rescued off the coast of Australia's Lennox Head, New South Wales (NSW), a different kind of savior showed up: a drone.

The lifeguard-piloted drone got to the men within 1 to 2 minutes They were exhausted but unharmed

In what's being hailed as a first-of-its-kind rescue, the new lifesaving device -- the Little Ripper UAV -- flew into action after someone spotted the swimmers in distress in a nearly 10-foot (3-meter) swell more than a half mile (about 1 kilometer) off a patrolled area, Surf Life Saving NSW said in a news release.

Within minutes, lifeguards piloted the drone to the men and dropped an inflatable life preserver.

The two clung to the rescue pod and made it to shore, where lifeguards were waiting, Surf Life Saving NSW said. They were exhausted but unharmed. And the drone had recorded the whole rescue.

"The Little Ripper UAV certainly proved itself today. It is an amazingly efficient piece of lifesaving equipment and a delight to fly," said Lifeguard Supervisor Jai Sheridan, who piloted the drone during the rescue.

"I was able to launch it, fly it to the location, and drop the pod all in about 1 to 2 minutes," he said. "On a normal day, that would have taken our lifeguards a few minutes longer to reach."

The rescue, which happened as lifeguards from the Australian Lifeguard Service were preparing for a training session with the brand-new drone fleet, was lauded as groundbreaking.

"Never before has a drone fitted with a flotation device been used to rescue swimmers like this," Deputy State Premier John Barilaro told the BBC.

The NSW government invested $430,000 in funding to Surf Life Saving NSW for the drone project, the organization said.