We investigate the optical forces acting on a metallic nanoparticle when the nanoparticle is introduced within a photonic nanojet (PNJ). Optical forces at resonance and off-resonance conditions of the microcylinder or nanoparticle are investigated. Under proper polarization conditions, the whispering gallery mode can be excited in the microcylinder, even at off resonance provided that scattering from the nanoparticle is strong enough. The optical forces are enhanced at resonance either of the single microcylinder or of the nanoparticle with respect to the forces under off-resonant illuminations. We found that the optical forces acting on the nanoparticle depend strongly on the dielectric permittivity of the nanoparticle, as well as on the intensity and the beam width of the PNJ. Hence, metallic sub-wavelength nanoparticle can be efficiently trapped by PNJs. Furthermore, the PNJ’s attractive force can be simply changed to a repulsive force by varying the polarization of the incident beam. The changed sign of the force is related to the particle’s polarizability and the excitation of localized surface plasmons in the nanoparticle.