Inspired by the aerial prowess of flying insects, we demonstrate that their robotic counterpart, an insect-scale flapping-wing robot, can mimic an aggressive maneuver seen in natural fliers — landing on a vertical wall. Such acrobatic movement differs from simple lateral maneuvers or hover, and therefore requires additional considerations in the control strategy. Magnetic force was chosen to enable attachment to the vertical surface due to its simplicity. We show that by learning from previous failed attempts, the robotic fly could successfully perch on a magnetic wall after eight iterations.