Asphalt and pitch had been worked in Mexico since the time of the Aztecs. Small quantities of oil were first refined into kerosene around 1876 near Tampico. By 1917 commercial quantities of oil were being extracted and refined by subsidiaries of the British Pearson and American Doheny companies, and had attracted the attention of the Mexican government who then claimed all mineral rights for the state as part of its Constitution.
In 1938, president Lázaro Cárdenas sided with oil workers striking against foreign-owned oil companies for an increase in pay and social services. On March 18, 1938 citing the 27th article of the 1917 constitution, President Lázaro Cárdenas embarked on the state-expropriation of all resources and facilities, nationalizing the U.S. and Anglo-Dutch operating companies, creating PEMEX. In retaliation, many foreign governments closed their markets to Mexican oil. In spite of the boycott, PEMEX developed into one of the largest oil companies in the world and helped Mexico become the fifth-largest oil exporter in the world.
PEMEX is the sole supplier of all commercial gasoline (petrol/diesel) stations in Mexico. All petrol stations, although labeled PEMEX, are concessions that are strictly full-service. PEMEX tried to take away the concessions from a large number of these for low-quality gasoline (often cut with up to 40% fuel oil) and for not serving the correct amount of gasoline (many serve only 9 litres for every 10 registered on the pump), however a judge ruled these were "not reasons to take away the concessions".
The grades of PEMEX gasoline are "Magna" (regular unleaded 87 octane—green pump handle) and "Premium" (92 octane—red pump handle). Previously, PEMEX offered a leaded gasoline called "Nova", but this has been discontinued for environmental reasons and due to stringent health regulations.
Some Pemex stations accept U.S. dollars and they are beginning to accept major credit cards.
Other customers of the gas stations have been victims of "baptized" gasoline, meaning that approximately 3/4 liters of gasoline are mixed with 1/4 liters of water, in order to create a full liter capable of passing the weight inspections.
Despite its current $77 billion in revenue, PEMEX pays high taxes that contribute with a large portion of the budget of the federal government. In recent years the company has only been able to make ends meet through massive borrowing, so that it now owes a staggering $42.5 billion, including $24 billion in off-balance-sheet debt because the Mexican government treats the company as a major source of revenue. The state-run company pays out over 60% of its revenue in royalties and taxes, and those funds pay for two fifths of the federal government's budget. In 2005, with record-breaking oil prices, the company has seen an unexpected excess of funds. This trend continued in 2006, but these funds have been used to pay salaries of bureaucrats and current costs, instead of being invested in projects of exploration and production; during the President Fox administration, these funds represent around 70 billion dollars, yet the administration says there is not enough money to pay the debts.
To help capitalize the company, former President Vicente Fox brought forward the possibility of making shares of PEMEX available to Mexican citizens and pension funds, to complement a current project-specific investment setup known as "Proyectos de Inversión Diferida En El Registro del Gasto" or PIDIREGAS; this proposal, along with alleviating PEMEX's heavy tax burden and a substantial budget increase, have met opposition in Congress.
President Calderon made clear at the beginning of his presidency that he would respect the constitutional mandate to keep Pemex in government hands, but that he would try his best to open up the sector to private investment.
Annual production has dropped each year since 2004. Furthermore, it has been reported the 2005-2006 daily oil production was down by approximately 500,000 barrels a day (a large proportion of the country's 4.5 million barrels) on the previous year.