Abstract A sample of two-jet events from the UA1 experiment at the CERN pp̄ Collider has been used to study the fragmentation of high-energy quark and gluon jets into charged hadrons. Compared with lower-energy jets observed in e +e − and pp collisions, the fragmentation function measured in the present experiment is softer (i.e. peaked to smaller values of z) and the mean internal transverse momentum is larger, mainly because of the effects of the QCD scaling violations. Using our knowledge of the quark and gluon structure functions in the proton, together with the QCD matrix elements, a statistical separation of quark and gluon jets is achieved within the present experiment. The fragmentation function for the gluon jets is found to be softer, and the angular spread of the fragmentation products larger, than is the case for quark jets.