Guerra de Ifni
Tarfaya was occupied by the British in 1882, when they built a trading post called Casa del Mar. The building is currently in a state of complete disrepair. The Sahrawi tribes then solicited the intervention of Sultan Hassan I who negotiated the withdrawal of the British in 1895 by Treaty of Cape Juby. In 1912 the territory of Tarfaya, then named Cape Juby, was part of the Spanish Sahara. The greater Cape Juby region was unified with Morocco in 1958, at the end of the Ifni War. In December 2014 the Tarfaya Wind Farm, the largest wind farm in Africa, was commissioned.