Abstract Crude oil often contains water, inorganic salts, suspended solids, and water-soluble trace metals. The first step in the refining processes is to reduce these contaminants by desalting (dehydration) in order to remove corrosion, plugging, and fouling of equipment and also to prevent poisoning the catalysts in the processing units. Sodium, calcium and magnesium chlorides (NaCl, CaCl 2 and MgCl 2) are frequently found in crude oil. Presence of these compounds in crude oil can cause several problems in the refining processes. At high temperature, water is hydrolyzed, and forms hydrochloric acid (HCl). Also, salts which contain metals can poison the catalysts. Desalting units remove contaminants from crude oil by washing water. After the oil is washed and mixed, demulsifying chemicals are added and then the electrostatic fields are used to break the emulsion. About 2–6% wash water is added to the oil as an extraction agent. Desalter effluent is a combination of many things such as: brine washing water used for removing salt, sand and mud washing water jet used at periodic intervals, connate water produced from the reservoir with crude oil. Desalter’s wastewater contains oil, demulsifier, and oxygen scavenger. Oil contamination is decreased by API separator in Ahwaz, Iran desalting units. The API separator in these units does not meet the standard requirement, because the salinity and organic content of the wastewater is very high. Therefore, the wastewater is injected to dead wells with high pressure. The injecting system has high capital and operational cost. In this research, desalting effluents is treated by using membrane distillation (MD). A polymeric Teflon microfiltration (MF) membrane is employed and the effect of operational conditions is investigated. Very effective separation (high flux and less contaminates in the permeate side) is observed. It is found that this method reduces capital, and operational cost and energy consumption. Besides, water (the permeate) fulfills the watering standards and can be used for agricultural and plant raw water applications.