A saturable absorber (SA) based on niobium diselenide (NbSe2), which is a layered transition metal dichalcogenide (TMD) in the VB group, is fabricated by the optically driven deposition method, and the related nonlinear optical properties are characterized. The modulation depth, saturable intensity, and nonsaturable loss of the as-prepared NbSe2 nanosheet-based SA are measured to be 16.2%, 0.76 MW/cm2, and 14%, respectively. By using the as-fabricated NbSe2 SA, a highly stable, passively Q-switched, erbium-doped, all-fiber laser is realized. The obtained shortest pulse width is 1.49 μs, with a pulse energy of 48.33 nJ at a center wavelength of 1560.38 nm. As far as we know, this is the shortest pulse duration ever obtained by an NbSe2 SA in a Q-switched fiber laser.