The mid-infrared (mid-IR) spectral region holds great promise for new laser-based sensing technologies, based on measuring strong mid-IR molecular absorption features. Practical applications have been limited to date, however, by current low-brightness broadband mid-IR light sources and slow acquisition-time detection systems. Here, we report a new approach by developing a swept-wavelength mid-infrared fiber laser, exploiting the broad emission of dysprosium, and using an acousto-optic tunable filter to achieve electronically controlled swept-wavelength operation from 2.89 to 3.25 μm (3070-3460 cm-1 ). Ammonia (NH3) absorption spectroscopy is demonstrated using this swept source with a simple room-temperature single-pixel detector, with 0.3 nm resolution and 40 ms acquisition time. This creates new opportunities for real-time high-sensitivity remote sensing using simple, compact mid-IR fiber-based technologies.