The position is subordinated to the president, who is the actual head of government.
The functions and powers of the prime minister are described in the Constitution of Tanzania: Article 52 The incumbent prime minister, Kassim Majaliwa was appointed by the president John Magufuli.
The position of Deputy Prime Minister in Tanzania is not a constitutionally recognized position, however, under article Section 36 (1) “the President shall have authority to constitute and to abolish any office in the service of the Government of the United Republic”.
This discretion has led to the position of deputy prime minister to be established several times throughout history.
Typically the role has been established for political reasons to exceptional service members of the cabinet.