Reduction of nitrothiophenol (I) by hydrogenation over Pd/C in THF affords substituted aniline (II), which is then cyclized with 2,4-dichloropyrimidine-5-carbonyl chloride (III) in THF in the presence of Amberlyst A-27 to yield the final product.