Zanzibar's MPs have passed a bill barring foreigners - including mainland Tanzanians - from working on the archipelago when locals can do the job.
Tourism is the island's main source of cash
The bill was unanimously passed, with MPs expressing the hope that it will bring down unemployment in Zanzibar.
Some locals complain that East Africans take jobs in the tourism industry that could be filled by Zanzibaris.
Labour official Omar Shajar told the BBC the intention was to prioritise islanders but not exclude mainlanders.
The issue is likely to be controversial in mainland Tanzania, where Zanzibaris do not require work permits.
The bill which still needs presidential assent in order to become law requires all foreigners to apply for permission to work on the island before they arrive and limits their employment in Zanzibar to four years.
Violators, illegal foreign workers and their employers could face fines and a three-month jail sentence.
Under the 1964 act of union, Zanzibar was allowed to remain semi-autonomous and to have its own president while benefiting from the economic and political clout of the mainland.
Zanzibar already has its own parliament, executive, legal system, national anthem and flag.