Two challenges should be overcome for the ultra‐precision machining of micro‐optical element with freeform curved surface: one is the intricate geometry, the other is the hard‐to‐machining optical materials due to their hardness, brittleness or flexibility. Here scanning electrochemical probe lithography (SECPL) is developed, not only to meet the machining need of intricate geometry by 3D direct writing, but also to overcome the above mentioned mechanical properties by an electrochemical material removal mode. Through the electrochemical probe a localized anodic voltage is applied to drive the localized corrosion of GaAs. The material removal rate is obtained as a function of applied voltage, motion rate, scan segment, etc. Based on the material removal function, an arbitrary geometry can be converted to a spatially distributed voltage. Thus, a series of micro‐optical element are fabricated with a machining accuracy in the scale of 100 s of nanometers. Notably, the spiral phase plate shows an excellent performance to transfer parallel light to vortex beam. SECPL demonstrates its excellent controllability and accuracy for the ultra‐precision machining of micro‐optical devices with freeform curved surface, providing an alternative chemical approach besides the physical and mechanical techniques.