A search for long-lived particles decaying into jets is presented. Data were collected with the CMS detector at the LHC from proton-proton collisions at a center-of-mass energy of 13 TeV in 2016, corresponding to an integrated luminosity of 35.9 fb-1. The search examines the distinctive topology of displaced tracks and secondary vertices. The selected events are found to be consistent with standard model predictions. For a simplified model in which long-lived neutral particles are pair produced and decay to two jets, pair production cross sections larger than 0.2 fb are excluded at 95% confidence level for a long-lived particle mass larger than 1000 GeV and proper decay lengths between 3 and 130 mm. Several supersymmetry models with gauge-mediated supersymmetry breaking or R-parity violation, where pair-produced long-lived gluinos or top squarks decay to several final-state topologies containing displaced jets, are also tested. For these models, in the mass ranges above 200 GeV, gluino masses up to 2300-2400 GeV and top squark masses up to 1350-1600 GeV are excluded for proper decay lengths approximately between 10 and 100 mm. These are the most restrictive limits to date on these models.