The residual amount of halogenated solvents in olive oil is an important indicator of its quality. The National Olive Oil Quality Standard GB/T 23347-2021 states that the residual amount of individual halogenated solvents in olive oil should be ≤0.1 mg/kg and that the total residual amount of halogenated solvents should be ≤0.2 mg/kg. COI/T.20/Doc. No. 8-1990, which was published by the International Olive Council, describes the standard method used for the determination of halogenated solvents in olive oil. Unfortunately, this method is cumbersome, has poor repeatability and low automation, and is unsuitable for the detection and analysis of residual halogenated solvents in large quantities of olive oil. At present, no national standard method for determining residual halogenated solvents in olive oil is available in China. Thus, developing simple, efficient, accurate, and stable methods for the determination of residual halogenated solvents in olive oil is imperative. In this paper, a method based on automatic headspace gas chromatography was established for the determination of residual halogenated solvents, namely, chloroform, carbon tetrachloride, 1,1,1-trichloroethane, dibromochloromethane, tetrachloroethylene, and bromoform, in olive oil. The samples were processed as follows. After mixing, 2.00 g (accurate to 0.01 g) of the olive oil sample was added into a 20 mL headspace injection bottle and immediately sealed for headspace gas chromatography analysis. Blank virgin olive oil was used to prepare a standard working solution and the external standard method for quantification. The solvents used in the preparation of halogenated solvent standard intermediates were investigated and methanol was selected as a replacement for N,N-dimethylacetamide to prepare a halogenated solvent standard intermediate owing to its safety. The effects of different injection times (1, 2, 3, 4, 5, 6 s), equilibration temperatures (60, 70, 80, 90, 100, 110, 120 ℃), and equilibration times (4, 5, 8, 10, 20, 30, 40 min) of the headspace sampler on the detection of the residual amounts of the six halogenated solvents were investigated. The optimal injection time and equilibration temperature were 3 s and 90 ℃, respectively. The method demonstrated good analytical performance for the six halogenated solvents when the equilibration time was 30 min. A methodological study was conducted on the optimized method, and the results showed that the six halogenated solvents exhibited good linear relationships in the range of 0.002-0.200 mg/kg, with correlation coefficients of ≥0.9991. The limits of detection (LODs) and quantification (LOQs) of 1,1,1-trichloroethane and bromoform were 0.0006 and 0.002 mg/kg, respectively. The LODs and LOQs of chloroform, carbon tetrachloride, dibromochloromethane, and tetrachloroethylene were 0.0003 and 0.001 mg/kg, respectively. The average recoveries under different spiked levels were 85.53%-115.93%, and the relative standard deviations (n=6) were 1.11%-8.48%. The established method was used to analyze 13 olive oil samples available in the market. Although no halogenated solvents were detected in these samples, a limited number of samples does not represent all olive oils. Hence, monitoring residual halogenated solvents in olive oil remains necessary for its safe consumption. The LOQs of the method for the six halogenated solvents were significantly lower than that of the COI/T.20/Doc. No. 8-1990 standard method (0.02 mg/kg). In addition, the developed method can be conducted under short operation times with high precision and degree of automation as well as good accuracy. Thus, the proposed method is suitable for the determination and analysis of the residues of the six halogenated solvents in large batches of olive oil samples.