A mode-tracking system that includes a mode-controlling subsystem has been incorporated into an external-cavity (EC) quantum cascade laser that operates in a mid-infrared wavelength range. The mode-tracking system makes it possible to perform mode-hop-free wavelength scans, as needed for high-resolution spectroscopy and detection of trace gases. The laser includes a gain chip, a beam-collimating lens, and a diffraction grating. The grating is mounted on a platform, the position of which can be varied to effect independent control of the EC length and the grating angle. The position actuators include a piezoelectric stage for translation control and a motorized stage for coarse rotation control equipped with a piezoelectric actuator for fine rotation control. Together, these actuators enable control of the EC length over a range of about 90 μm with a resolution of 0.9 nm, and control of the grating angle over a coarse-tuning range of ±6.3° and a fine-tuning range of ±520 μrad with a resolution of 10 nrad. A mirror mounted on the platform with the grating assures always the same direction of the output laser beam.