We analyze a sample of 139 near-Earth asteroids (NEAs), defined as those that reach perihelion distances q<1.3au, and that also fulfill the conditions of approaching or crossing Jupiter’s orbit (aphelion distances Q>4.8au), having Tisserand parameters 2<T<3 and orbital periods P<20yr. In order to compare the dynamics, we also analyze a sample of 42 Jupiter family comets (JFCs) in near-Earth orbits, i.e. with q<1.3au. We integrated the orbits of these two samples for 104yr in the past and in the future. We find that the great majority of the NEAs move on stable orbits during the considered period, and that a large proportion of them are in one of the main mean motion resonances with Jupiter, in particular the 2:1. We find a strong coupling between the perihelion distance and the inclination in the motion of most NEAs, due to Kozai mechanism, that generates many sungrazers. On the other hand, most JFCs are found to move on very unstable orbits, showing large variations in their perihelion distances in the last few 102–103yr, which suggests a rather recent capture in their current near-Earth orbits. Even though most NEAs of our sample move in typical ‘asteroidal’ orbits, we detect a small group of NEAs whose orbits are highly unstable, resembling those of the JFCs. These are: 1997 SE5, 2000 DN1, 2001 XQ, 2002 GJ8, 2002 RN38, 2003 CC11, 2003 WY25, 2009 CR2, and 2011 OL51. These objects might be inactive comets, and indeed 2003 WY25 has been associated with comet Blanpain, and it is now designed as Comet 289P/Blanpain. Under the assumption that these objects are inactive comets, we can set an upper limit of ∼0.17 to the fraction of NEAs with Q>4.8au of cometary origin, but it could be even lower if the NEAs in unstable orbits listed before turn out to be bona fide asteroids from the main belt. This study strengthens the idea that NEAs and comets essentially are two distinct populations, and that periods of dormancy in comets must be rare. Most likely, active comets in near-Earth orbits go through a continuous erosion process in successive perihelion passages until disintegration into meteoritic dust and fragments of different sizes. In this scenario, 289P/Blanpain might be a near-devolatized fragment from a by now disintegrated parent comet.