structural:summarization, information:extraction
History

The earliest known oil wells were drilled in China in 347 CE. These wells had depths of up to about 240 metres (790 ft) and were drilled using bits attached to bamboo poles. The oil was burned to evaporate brine producing salt. By the 10th century, extensive bamboo pipelines connected oil wells with salt springs. The ancient records of China and Japan are said to contain many allusions to the use of natural gas for lighting and heating. Petroleum was known as burning water in Japan in the 7th century.

According to Kasem Ajram, petroleum was distilled by the Persian alchemist Muhammad ibn Zakarīya Rāzi (Rhazes) in the 9th century, producing chemicals such as kerosene in the alembic (al-ambiq), and which was mainly used for kerosene lamps. Arab and Persian chemists also distilled crude oil in order to produce flammable products for military purposes. Through Islamic Spain, distillation became available in Western Europe by the 12th century.

Some sources claim that from the 9th century, oil fields were exploited in the area around modern Baku, Azerbaijan, to produce naphtha for the petroleum industry. These places were described by Marco Polo in the 13th century, who described the output of those oil wells as hundreds of shiploads. When Marco Polo in 1264 visited Baku, on the shores of the Caspian Sea, he saw oil being collected from seeps. He wrote that "on the confines toward Geirgine there is a fountain from which oil springs in great abundance, in as much as a hundred shiploads might be taken from it at one time."

In 1846, Baku (settlement Bibi-Heybat) the first ever well was drilled with percussion tools to a depth of 21 metres (69 ft) for oil exploration. In 1846–1848, the first modern oil wells were drilled on the Absheron Peninsula north-east of Baku, by Russian engineer Vasily Semyonov applying the ideas of Nikolay Voskoboynikov.

Ignacy Łukasiewicz, a Polish pharmacist and petroleum industry pioneer drilled one of the world's first modern oil wells in 1854 in Polish village Bóbrka, Krosno County who in 1856 built one of the world's first oil refineries.

In North America, the first commercial oil well entered operation in Oil Springs, Ontario in 1858, while the first offshore oil well was drilled in 1896 in the Summerland Oil Field on the California Coast.

The earliest oil wells in modern times were drilled percussively, by repeatedly raising and dropping a bit on the bottom of a cable into the borehole. In the 20th century, cable tools were largely replaced with rotary drilling, which could drill boreholes to much greater depths and in less time. The record-depth Kola Borehole used a mud motor while drilling to achieve a depth of over 12,000 metres (12 km; 39,000 ft; 7.5 mi).

Until the 1970s, most oil wells were essentially vertical, although lithological variations cause most wells to deviate at least slightly from true vertical (see deviation survey). However, modern directional drilling technologies allow for highly deviated wells that can, given sufficient depth and with the proper tools, actually become horizontal. This is of great value as the reservoir rocks that contain hydrocarbons are usually horizontal or nearly horizontal; a horizontal wellbore placed in a production zone has more surface area in the production zone than a vertical well, resulting in a higher production rate. The use of deviated and horizontal drilling has also made it possible to reach reservoirs several kilometers or miles away from the drilling location (extended reach drilling), allowing for the production of hydrocarbons located below locations that are difficult to place a drilling rig on, environmentally sensitive, or populated.