In this work, we perform high-speed imaging and numerical simulation to investigate the transient dynamics of cavitation bubbles near the end of a slender cylinder. The bubble dynamics can be categorized into four distinct regimes in terms of the types of bubble collapse, corresponding to the regular jet, needle jet, in-phase double jets, and anti-phase double jets, respectively, depending on two dimensionless parameters, the normalized cylinder radius η (=rc/Rmax, where rc is the cylinder radius and Rmax is the spherical bubble radius at maximum expansion), and the dimensionless standoff distance γ (=SD/Rmax, where SD is the standoff distance between the end surface of the cylinder and bubble center). The peak velocity of the liquid jet could easily reach a supersonic state in the regime of the needle jet when the cavitation bubble collapses near a slender cylinder, and the maximum jet velocity can reach up to 635 m/s. Quantitative analysis of the evolution of pressure distribution also indicates that the end surface of the cylinder will have strong hydrodynamic pressure loading, particularly for the case of η=0.3 and γ ranging from 0.5 to 0.83. Additionally, we find that the collapse time of the cavitation bubble near a slender cylinder is close to the Rayleigh collapse time. We believe that our findings can be valuable in mitigating or utilizing cavitation near solid cylinders.