The compound [Co(μ-ox)(Hpmtz)] (Hpmtz = 5-pyrimidyltetrazole, ox = oxalate) has been synthesized under hydrothermal conditions by reacting CoCl2·6H2O with 2-cyanopyrimidine and sodium azide. Both ox and Hpmtz ligands were generated in situ during the hydrothermal reaction. The structure of [Co(µ-ox)(Hpmtz)] consists of oxalate-bridged CoII zig-zag chains bearing Hpmtz chelating ligands. These chains form layers in the ab plane via π···π stacking interactions involving the pmtz ligands belonging to neighbouring chains. Layers stack along the c axis with an ABAB sequence and are glued by cooperative C9–H···O4 interactions leading to a 3D structure. Magnetic susceptibility measurements indicate that this compound shows spin-canted antiferromagnetism (weak ferromagnetism) with TC = 6.5 K.