This document presents a three-phase grid-connected inverter that uses current regulation. It uses a particle swarm optimization algorithm to tune the proportional-integral parameters for the current regulators in order to minimize total harmonic distortion. Simulation results show that the parameters optimized by particle swarm optimization produce lower THD compared to those from a genetic algorithm or conventional Ziegler-Nichols tuning method. An LCL filter is also used to reduce harmonics at the inverter output.