An official from the National Search and Rescue Agency says they received a distress call from the ship's captain on Sunday and went to their aid. The Afghans were taken by tanker to a port on the western side of Indonesia's Java Island.
Witnesses said Monday that police were still negotiating with the migrants who were refusing to leave the tanker.
The official says they will be handed over to immigration officers. Migrants without legal documents are usually deported home while others may apply for asylum.
Migrants from conflict-ridden countries have long used Indonesia's thousands of islands as a transit point for their way to Australia.