Iranian reports said a frigate and a supply ship headed to the unnamed vessel on Thursday morning.
The tanker was being approached by armed men on eight boats.
Iranian forces exchanged fire with the pirates and caused them to retreat.
No injuries were reported on the tanker or the warships.