We calculate the cross sections for the direct hadroproduction of J/psi and Upsilon associated with a heavy-quark pair of the same flavour at leading order in alpha_S and v in NRQCD. These processes provide an interesting signature that could be studied at the Tevatron and the LHC and also constitute a gauge-invariant subset of the NLO corrections to the inclusive hadroproduction of J/psi and Upsilon. We find that the fragmentation approximation commonly used to evaluate the contribution of these processes to the inclusive quarkonium production sizeably underestimates the exact calculation in the kinematical region accessible at the Tevatron. Both J/psi and Upsilon are predicted to be unpolarised, independently of their transverse momentum.