The title pyrimidine derivative, C7H8N4S, is essentially planar, with a maximum deviation of 0.029 (2) A ° from the mean plane of the non-H atoms. In the crystal, molecules are linked by an intermolecular bifurcated N—H  N hydrogen bond between the cyano N atom and the two amino groups, an N—H  N hydrogen bond between the two amino groups and a weak C—H   interaction, forming a three-dimensional network.