Establishing the structure of molecules and solids has always had an essential role in physics, chemistry and biology. The methods of choice are X-ray and electron diffraction, which are routinely used to determine atomic positions with sub-ångström spatial resolution. Although both methods are currently limited to probing dynamics on timescales longer than a picosecond, the recent development of femtosecond sources of X-ray pulses and electron beams suggests that they might soon be capable of taking ultrafast snapshots of biological molecules and condensed-phase systems undergoing structural changes. The past decade has also witnessed the emergence of an alternative imaging approach based on laser-ionized bursts of coherent electron wave packets that self-interrogate the parent molecular structure. Here we show that this phenomenon can indeed be exploited for laser-induced electron diffraction (LIED), to image molecular structures with sub-ångström precision and exposure times of a few femtoseconds. We apply the method to oxygen and nitrogen molecules, which on strong-field ionization at three mid-infrared wavelengths (1.7, 2.0 and 2.3 μm) emit photoelectrons with a momentum distribution from which we extract diffraction patterns. The long wavelength is essential for achieving atomic-scale spatial resolution, and the wavelength variation is equivalent to taking snapshots at different times. We show that the method has the sensitivity to measure a 0.1 Å displacement in the oxygen bond length occurring in a time interval of ∼5 fs, which establishes LIED as a promising approach for the imaging of gas-phase molecules with unprecedented spatio-temporal resolution.