Libya was a very poor agricultural country with bleak economic prospects until 1958, when petroleum was discovered 200–300 mi (320–480 km) S and SE of the Gulf of Sidra; crude petroleum was exported on an increasingly significant scale between 1961 and 1981. Oil income increased markedly in 1972–73, when the government nationalized (with compensation) 51% ownership in subsidiaries of foreign petroleum firms operating in the country. The remaining subsidiaries were completely nationalized. At the same time, the price of petroleum rose dramatically, further increasing Libya's receipts. Since then, the economy has been almost inextricably linked to world oil prices.
Much of the income from petroleum was used to improve the cities, to modernize transportation, and to build up the military. The resulting migration of Libyans to urban areas created a growth in unemployment, spurring the government to invest in agricultural development in order to make farming more attractive. Although petroleum production has dropped since the 1970s, oil exports continue to generate about 95% of export earnings and 25% of the country's GDP. Libya is also a major exporter of natural gas and has several large gas liquefication plants. In addition, gypsum, salt, and limestone are produced in significant quantities. Libya has increased industrial production in recent years. The principal manufactures are refined petroleum, liquefied natural gas, petrochemicals, iron and steel, aluminum, textiles, handicrafts, and construction materials. Food processing is also important.
Farming is severely limited by the small amount of fertile soil and the lack of rainfall, and Libya must import about 75% of its food. The chief agricultural products are wheat, barley, olives, dates, citrus fruit, vegetables, peanuts, and soybeans. Large numbers of cattle, sheep, and goats are raised. Most of the arable land is located in Tripolitania. To increase the amount of cultivatable land, a massive water development project, called "The Great Manmade River," was begun in 1984. It is designed to carry water from underground aquifers in the Sahara through a 2,400 mi (3,862 km) pipeline system to irrigate 313 sq mi (811 sq km) in the coastal region. By 1997, the system was connected to the cities of Tripoli, Surt (Sirte), and Benghazi and also provided thousands of acres of farmland with irrigation water.
Libya's annual earnings from exports are usually much higher than the cost of its imports, and in the 1990s it had the highest per capita GDP in Africa. Crude petroleum and natural gas are by far the leading exports; the main imports are machinery, transportation equipment, foodstuffs, and manufactured consumer goods. The principal trading partners are Italy, Germany, Turkey, France, and Spain.