A petrol engine (known as a gasoline engine in American English) is an internal combustion engine with spark-ignition, designed to run on petrol (gasoline) and similar volatile fuels.
In most petrol engines, the fuel and air are usually mixed after compression (although some modern petrol engines now use cylinder-direct petrol injection). The pre-mixing was formerly done in a carburetor, but now it is done by electronically controlled fuel injection, except in small engines where the cost/complication of electronics does not justify the added engine efficiency. The process differs from a diesel engine in the method of mixing the fuel and air, and in using spark plugs to initiate the combustion process. In a diesel engine, only air is compressed (and therefore heated), and the fuel is injected into very hot air at the end of the compression stroke, and self-ignites.
The first practical petrol engine was built in 1876 in Germany by Nikolaus August Otto, although there had been earlier attempts by Étienne Lenoir, Siegfried Marcus, Julius Hock and George Brayton.
With both air and fuel in a closed cylinder, compressing the mixture too much poses the danger of auto-ignition — or behaving like a diesel engine. Because of the difference in burn rates between the two different fuels, petrol engines are mechanically designed with different timing than diesels, so to auto-ignite a petrol engine causes the expansion of gas inside the cylinder to reach its greatest point before the cylinder has reached the “top dead center” (T.D.C) position.