When insects are flying forwards, the image of the ground sweeps backwards across their ventral viewfield, forming an "optic flow", which depends on both the groundspeed and the height of flight. To explain how these animals manage to avoid the ground using this image motion cue, we suggest that insect navigation hinges on a visual feedback loop we have called the optic flow regulator, which controls the vertical lift. To test this idea, we built a micro-helicopter equipped with a fly-inspired optic flow sensor and an optic flow regulator. We showed that this fly-by-sight microrobot can perform exacting tasks such as takeoff , level flight and landing. Our control scheme accounts for many hitherto unexplained findings published during the last 70 years on insects' visually guided performances, including the facts that honeybees descend under headwind conditions, land with a constant slope and drown when travelling over mirror-smooth water. Our control scheme explains how insects manage to fly safely without any of the instruments used onboard aircraft to measure the height of flight, the airspeed, the groundspeed, and the descent speed. An optic flow regulator could be easily implemented neurally. It is just as appropriate for insects (1) as it would be for aircraft (2,3).