ABSTRACT We present a coherent database of spectroscopic observations of far-IR fine-structure lines from the Herschel/Photoconductor Array Camera and Spectrometer archive for a sample of 170 local active galactic nuclei (AGNs), plus a comparison sample of 20 starburst galaxies and 43 dwarf galaxies. Published Spitzer/IRS and Herschel/SPIRE line fluxes are included to extend our database to the full 10–600 μm spectral range. The observations are compared to a set of Cloudy photoionization models to estimate the above physical quantities through different diagnostic diagrams. We confirm the presence of a stratification of gas density in the emission regions of the galaxies, which increases with the ionization potential of the emission lines. The new [O iv] /[O iii] versus [Ne iii] /[Ne ii] diagram is proposed as the best diagnostic to separate (1) AGN activity from any kind of star formation and (2) low-metallicity dwarf galaxies from starburst galaxies. Current stellar atmosphere models fail to reproduce the observed [O iv] /[O iii] ratios, which are much higher when compared to the predicted values. Finally, the ([Ne iii] + [Ne ii] )/([S iv] +[S iii] ) ratio is proposed as a promising metallicity tracer to be used in obscured objects, where optical lines fail to accurately measure the metallicity. The diagnostic power of mid- to far-infrared spectroscopy shown here for local galaxies will be of crucial importance to study galaxy evolution during the dust-obscured phase at the peak of the star formation and black hole accretion activity ( ). This study will be addressed by future deep spectroscopic surveys with present and forthcoming facilities such as the James Webb Space Telescope, the Atacama Large Millimeter/submillimeter Array, and the Space Infrared telescope for Cosmology and Astrophysics.