The sailors were dropped off late on Saturday in Puntland's capital Garowe. It was not immediately clear which vessel they came from, or whether any ransom was paid. Somali sea gangs have been holding at least 13 ships and more than 230 crew hostage.
"I can't tell them apart, but they are from India and Bangladesh," said Ali Said, a driver hired by the gunmen to take the former captives to Garowe from Eyl, a pirate stronghold.
"Now they are all healthy and at a hotel here waiting for their departure, although they do not have even one penny for transport," Said told Reuters by telephone from Garowe.
He said the Indian and Bangladeshi sailors had been on board a fishing boat when they were abducted off Oman, but Said said he did not know its name or when the hijacking had taken place.
Patrols by a multinational naval force in the strategic shipping lanes that link Europe to Asia through the busy Gulf of Aden only appear to have forced the sea gangs to extend their range and strike deeper into the Indian Ocean.