The objective of this study was to combine coagulation and mechanically induced air flotation in order to determine the optimum operational condition for the removal of total petroleum hydrocarbons (TPHs) from oily wastewater. A mixture of water, gas oil, and emulsifier was used to generate a stable emulsion as the simulated wastewater. Aluminum sulfate, ferric chloride, and polyaluminum chloride were employed as coagulants to destabilize the emulsions, and the subsequent separation of hydrocarbons was carried out in a mechanical flotation cell. Considering the multiplicity of factors in both stages of coagulation and flotation, the effects of each factor were studied using Taguchi design of experiments technique, and the optimum conditions were revealed. The results showed that at the optimal conditions, about 93% TPH removal was achieved by addition of 50 mg/l aluminum sulfate at pH 4, flotation time of 10 min, impeller speed of 1,000 rpm, and airflow rate of 4.5 l/min.