A bi-fuel engine with the ability to run optimally on both compressed natural gas (CNG) and gasoline is being developed. Such bi-fuel automotive engines are necessary to bridge the gap between gasoline and natural gas as an alternative fuel while natural gas fueling stations are not yet common enough to make a dedicated natural gas vehicle practical. As an example of modern progressive engine design, a Saturn 1.9 liter 4-cylinder dual overhead cam (DOHC) engine has been selected as a base powerplant for this development. Many previous natural gas conversions have made compromises in engine control strategies, including mapped open-loop methods, or resorting to translating the signals to or from the original controller. The engine control system described here, however, employs adaptive closed-loop control, optimizing fuel delivery and spark timing for both fuels. Each fuel is metered by solenoid injectors and the fuel injection control maintains a preset air-fuel ratio using a universal exhaust gas oxygen sensor (UEGO). Spark timing is controlled to maintain the location of peak in-cylinder pressure at the optimum value for best torque, which was determined experimentally to be 14° after top dead center for this engine. In-cylinder pressure was measured in the experimental engine using piezoelectric pressure transducers flush-mounted in the cylinder head. Location of peak pressure was determined in real time with the IBM-compatible 486 computer used for control, and was used to modify the spark advance for the next engine event in that cylinder. Reductions in engine-out emissions of hydrocarbons, carbon dioxide, and oxides of nitrogen, as compared with stock operation, were observed when using the controller with gasoline. Further reductions in emissions were achieved with CNG operation, due to the properties of the fuel. An improvement in engine stability was also realized with the controller.