The magnetic properties of metal-functionalized graphitic carbon nitride nanotubes were investigated based on first-principles calculations. The graphitic carbon nitride nanotube can be either ferromagnetic or antiferromagnetic by functionalizing with different metal atoms. The W- and Ti-functionalized nanotubes are ferromagnetic, which are attributed to carrier-mediated interactions because of the coupling between the spin-polarized d and p electrons and the formation of the impurity bands close to the band edges. However, Cr-, Mn-, Co-, and Ni-functionalized nanotubes are antiferromagnetic because of the anti-alignment of the magnetic moments between neighboring metal atoms. The functionalized nanotubes may be used in spintronics and hydrogen storage.