Offshore drilling is a mechanical process where a wellbore is drilled below the seabed. It is typically carried out in order to explore for and subsequently extract petroleum that lies in rock formations beneath the seabed.  Most commonly, the term is used to describe drilling activities on the continental shelf, though the term can also be applied to drilling in lakes, inshore waters and inland seas.
 Offshore drilling presents environmental challenges, both offshore and onshore from the produced hydrocarbons and the materials used during the drilling operation. Controversies include the ongoing US offshore drilling debate.
 There are many different types of facilities from which offshore drilling operations take place. These include bottom founded drilling rigs (jackup barges and swamp barges), combined drilling and production facilities either bottom founded or floating platforms, and deepwater mobile offshore drilling units (MODU) including semi-submersibles or drillships. These are capable of operating in water depths up to 3,000 metres (9,800 ft). In shallower waters the mobile units are anchored to the seabed; however, in water deeper than 1,500 metres (4,900 ft), the semi-submersibles and drillships are maintained at the required drilling location using dynamic positioning.
 Around 1891, the first submerged oil wells were drilled from platforms built on piles in the fresh waters of the Grand Lake St. Marys in Ohio.  The wells were developed by small local companies such as Bryson, Riley Oil, German-American and Banker's Oil.
 Around 1896, the first submerged oil wells in salt water were drilled in the portion of the Summerland field extending under the Santa Barbara Channel in California.  The wells were drilled from piers extending from land out into the channel.
 Other notable early submerged drilling activities occurred on the Canadian side of Lake Erie in the 1900s and Caddo Lake in Louisiana in the 1910s.  Shortly thereafter wells were drilled in tidal zones along the Texas and Louisiana gulf coast.  The Goose Creek Oil Field near Baytown, Texas is one such example.  In the 1920s drilling activities occurred from concrete platforms in Venezuela's Lake Maracaibo.
 One of the oldest subsea wells is the Bibi Eibat well, which came on stream in 1923 in Azerbaijan.[dubious  – discuss]  The well was located on an artificial island in a shallow portion of the Caspian Sea.  In the early 1930s, the Texas Company developed the first mobile steel barges for drilling in the brackish coastal areas of the Gulf of Mexico.
 In 1937, Pure Oil and its partner Superior Oil used a fixed platform to develop a field 1 mile (1.6 km) offshore of Calcasieu Parish, Louisiana in 14 feet (4.3 m) of water.
 In 1938, Humble Oil built  a mile-long wooden trestle with railway tracks into the sea at McFadden Beach on the Gulf of Mexico, placing a derrick at its end – this was later destroyed by a hurricane.
 In 1945, concern for American control of its offshore oil reserves caused President Harry Truman to issue an Executive Order unilaterally extending American territory to the edge of its continental shelf, an act that effectively ended the 3-mile limit "freedom of the seas" regime.
 In 1946, Magnolia drilled at a site 18 miles (29 km) off the coast, erecting a platform in 18 feet (5.5 m) of water off St. Mary Parish, Louisiana.
 In early 1947, Superior Oil erected a drilling and production platform in 20 feet (6.1 m) of water some 18 miles (29 km) off Vermilion Parish, La.  But it was Kerr-Magee, as operator for partners Phillips Petroleum and Stanolind Oil & Gas that completed its historic Ship Shoal Block 32 well in October 1947, months before Superior actually drilled a discovery from their Vermilion platform farther offshore. In any case, that made Kerr-McGee's well the first oil discovery drilled out of sight of land.
 When offshore drilling moved into deeper waters of up to 30 metres (98 ft), fixed platform rigs were built, until demands for drilling equipment was needed in the 100 feet (30 m) to 120 metres (390 ft) depth of the Gulf of Mexico, the first jack-up rigs began appearing from specialized offshore drilling contractors.
 The first semi-submersible resulted from an unexpected observation in 1961. Blue Water Drilling Company owned and operated the four-column submersible Blue Water Rig No.1 in the Gulf of Mexico for Shell Oil Company. As the pontoons were not sufficiently buoyant to support the weight of the rig and its consumables, it was towed between locations at a draught midway between the top of the pontoons and the underside of the deck. It was noticed that the motions at this draught were very small, and Blue Water Drilling and Shell jointly decided to try operating the rig in the floating mode. The concept of an anchored, stable floating deep-sea platform had been designed and tested back in the 1920s by Edward Robert Armstrong for the purpose of operating aircraft with an invention known as the 'seadrome'. The first purpose-built drilling semi-submersible Ocean Driller was launched in 1963 by ODECO.. Since then, many semi-submersibles have been purpose-designed for the drilling industry mobile offshore fleet.
 The first offshore drillship was the CUSS 1 developed for the Mohole project to drill into the Earth's crust.
 As of June 2010, there were over 620 mobile offshore drilling rigs (jackups, semisubs, drillships, barges, etc.) available for service in the worldwide offshore rig fleet.
 One of the world's deepest hubs is currently the Perdido in the Gulf of Mexico, floating in 2,438 meters (7,999 ft) of water. It is operated by Royal Dutch Shell and was built at a cost of $3 billion. The deepest operational platform is the Petrobras America Cascade FPSO in the Walker Ridge 249 field in 2,600 meters (8,500 ft) of water.
 Offshore drilling is usually done from platforms generically known as mobile offshore drilling units (MODU), which can be of one of several formats, depending on the water depth:
 Notable offshore fields include:
 Offshore oil and gas production is more challenging than land-based installations due to the remote and harsher environment. Much of the innovation in the offshore petroleum sector concerns overcoming these challenges, including the need to provide very large production facilities. Production and drilling facilities may be very large and a large investment, such as the Troll A platform standing on a depth of 300 meters (980 ft).
 Another type of offshore platform may float with a mooring system to maintain it on location. While a floating system may be lower cost in deeper waters than a fixed platform, the dynamic nature of the platforms introduces many challenges for the drilling and production facilities.
 The ocean can add several thousand meters or more to the fluid column. The addition increases the equivalent circulating density and downhole pressures in drilling wells, as well as the energy needed to lift produced fluids for separation on the platform.
 The trend today is to conduct more of the production operations subsea, by separating water from oil and re-injecting it rather than pumping it up to a platform, or by flowing to onshore, with no installations visible above the sea. Subsea installations help to exploit resources at progressively deeper waters—locations which had been inaccessible—and overcome challenges posed by sea ice such as in the Barents Sea. One such challenge in shallower environments is seabed gouging by drifting ice features (means of protecting offshore installations against ice action includes burial in the seabed).
 Offshore manned facilities also present logistics and human resources challenges. An offshore oil platform is a small community in itself with cafeteria, sleeping quarters, management and other support functions. In the North Sea, staff members are transported by helicopter for a two-week shift. They usually receive higher salary than onshore workers do. Supplies and waste are transported by ship, and the supply deliveries need to be carefully planned because storage space on the platform is limited. Today, much effort goes into relocating as many of the personnel as possible onshore, where management and technical experts are in touch with the platform by video conferencing. An onshore job is also more attractive for the aging workforce in the petroleum industry, at least in the western world. These efforts among others are contained in the established term integrated operations. The increased use of subsea facilities helps achieve the objective of keeping more workers onshore. Subsea facilities are also easier to expand, with new separators or different modules for different oil types, and are not limited by the fixed floor space of an above-water installation.
 Offshore oil production involves environmental risks, most notably oil spills from oil tankers or pipelines transporting oil from the platform to onshore facilities, and from leaks and accidents on the platform (e.g. Deepwater Horizon oil spill and Ixtoc I oil spill). Produced water is also generated, which is water brought to the surface along with the oil and gas; it is usually highly saline and may include dissolved or unseparated hydrocarbons.