We have developed a method to synthesize alpha,alpha-dihaloketones under electrochemical conditions. In this reaction, the Cl- or Br- is oxidized to Cl-2 or Br-2 at the anode, which undergoes two-step addition reactions with the N,N-dimethyl enaminone, and finally breaks C=C of the N,N-dimethyl enaminone to generate alpha,alpha-dihaloketones. The electrosynthesis reaction can be conveniently carried out in an undivided electrolytic cell at room temperature. In addition, various functional groups are compatible with this green protocol which can be applied simultaneously to the gram scale without significantly lower yield. (C) 2021 Elsevier Ltd. All rights reserved.