Objective. Electrocorticogram (ECoG)-based brain-computer interfaces (BCIs) are a promising platform for the restoration of motor and sensory functions to those with neurological deficits. Such bi-directional BCI operation necessitates simultaneous ECoG recording and stimulation, which is challenging given the presence of strong stimulation artifacts. This problem is exacerbated if the BCI’s analog front-end operates in an ultra-low power regime, which is a basic requirement for fully implantable medical devices. In this study, we developed a novel method for the suppression of stimulation artifacts before they reach the analog front-end. Approach. Using elementary biophysical considerations, we devised an artifact suppression method that employs a weak auxiliary stimulation delivered between the primary stimulator and the recording grid. The exact location and amplitude of this auxiliary stimulating dipole were then found through a constrained optimization procedure. The performance of our method was tested in both simulations and phantom brain tissue experiments. Main results. The solution found through the optimization procedure matched the optimal canceling dipole in both simulations and experiments. Artifact suppression as large as 28.7 dB and 22.9 dB were achieved in simulations and brain phantom experiments, respectively. Significance. We developed a simple constrained optimization-based method for finding the parameters of an auxiliary stimulating dipole that yields optimal artifact suppression. Our method suppresses stimulation artifacts before they reach the analog front-end and may prevent the front-end amplifiers from saturation. Additionally, it can be used along with other artifact mitigation techniques to further reduce stimulation artifacts.