We have studied the focal mechanism of an Mw 4.0 earthquake that occurred on 8 October 2011 in the southwest of El Hierro (Canary Islands), the largest shock of the swarm that preceded the submarine eruption of El Hierro 2011–2012. The joint focal mechanism solution of 34 foreshocks has also been obtained. The results for the mainshock are consistent with a pure double‐couple mechanism of a strike‐slip motion with a reverse component and a focal depth of 12–13 km. The stress pattern obtained from the focal mechanism indicates horizontal compression in a north‐northwest–south‐southeast direction, parallel to the southern ridge of the island, and a quasi‐horizontal extension in an east–west direction. Similar stress pattern is derived from the joint solution of the foreshocks. The occurrence of this family of earthquakes at the moment of the maximum strain rate of the pre‐eruptive swarm suggests that their rupture process is related to tectonic stress, which led to the eruption only two days later, 5 km away from the mainshock epicenter.