Alkylation of phenothiazine (I) by ethyl chloroacetate (II) in the presence of K2CO3 affords the ester (III). Subsequent condensation of (III) with thiosemicarbazide (IV) gives the acyl thiosemicarbazide (V), which is cyclized to the thiadiazole derivative (VI) in concentrated H2SO4. Finally, Mannich condensation of aminothiadiazole (VI) with thiobarbituric acid (VII) and formaldehyde furnishes the desired compound.