An off-duty NJ Transit police officer has been hailed a hero for saving two men from dangerous rip currents off the Jersey Shore.

On Tuesday, Officer Zachary Sjosward was fishing with two friends at Island Beach State Park Beach — a location not staffed by lifeguards, according to NJ Transit police.

Sjosward went to get something from his vehicle and when he returned, both friends had “vanished” — apparently swept away from shore, reports.

The officer still managed to rescue his friends, relying on his water survival and intervention training.

Both men survived.