In the title compound, C5H3BrN4, the almost planar triazolopyrimidine ring system (r.m.s. deviation = 0.014 Å) carries a bromo substituent at the 5-position. In the crystal, C—H...N hydrogen bonds form inversion dimers enclosing R22(8) rings and also link molecules into C(5) chains along the c-axis direction. Br...N halogen bonds [3.185 (4) Å], π–π stacking interactions, centroid-to-centroid separation [3.663 (3) Å] and C—Br...π contacts [Br...Cg = 3.7881 (17) Å] are also found and combine with the C—H...N hydrogen bonds to stack the molecules along the a-axis direction.