We present the detection of hydrogen fluoride, HF, in two luminous nearby galaxies NGC 253 and NGC 4945 using the Heterodyne Instrument for the Far-Infrared (HIFI) on board the Herschel Space Observatory. The HF line toward NGC 253 has a P-Cygni profile, while an asymmetric absorption profile is seen toward NGC 4945. The P-Cygni profile in NGC 253 suggests an outflow of molecular gas with a mass of M(H2)out∼ 1 × 107 M⊙ and an outflow rate as large as M ∼ 6.4 M⊙ yr−1. In the case of NGC 4945, the axisymmetric velocity components in the HF line profile is compatible with the interpretation of a fast-rotating nuclear ring surrounding the nucleus and the presence of inflowing gas. The gas falls into the nucleus with an inflow rate of ≤ 1.2 M⊙ yr−1, inside a inner radius of ≤ 200 pc. The gas accretion rate to the central AGN is much smaller, suggesting that the inflow can be triggering a nuclear starburst. From these results, the HF J=1−0 line is seen to provide an important probe of the kinematics of absorbing material along the sight-line to nearby galaxies with bright dust continuum and a promising new tracer of molecular gas in high-redshift galaxies.