The assault began at a weekly market in Goronyo on Sunday and continued into Monday morning, Sokoto Governor Aminu Waziri Tambuwal said in a statement.
Gunmen across northwestern Nigeria have killed scores of people and kidnapped hundreds more for ransom over the past year in a security crisis that the government is trying to tackle via communications blackouts, military operations and stepped up policing.
Iliyasu Abba, a local resident and trader, told Reuters that there were 60 bodies at Goronyo General Hospital mortuary and that others sustained injuries while escaping.
"The gunmen stormed the market as it was crowded with shoppers and traders," he said.
The men were "shooting sporadically on us after they surrounded the market firing at every direction killing people."
Abba said the gunmen had at least initially overpowered police who tried to intervene. A police spokesman did not immediately respond to a request for comment.
The government ordered shut all telephone and internet services in the whole of Zamfara state in early September, a blackout later extended to parts of Katsina, Sokoto and Kaduna states as military operations intensified.
Nigeria's top general said last week the telecoms blackout would be maintained because it was helping the armed forces crack down on the bandits. But the closure has made it hard to know what is happening in the affected areas, and has disrupted daily life and business for millions.
Tambuwal requested more security forces in Sokoto and the deployment of more resources.