<span lang="EN-US">This paper develops particle swarm optimization integrated with gravitational search algorithm (PSO-GSA) to coordinate the relays in a distribution system with distributed generation (DG) connectivity. This algorithm combines PSO and GSA to improve the performance of the relay protection system. To prevent relay malfunctions following DG penetration, a suitable primary and backup relay is chosen. The PSO-GSA is coded using MATLAB software and tested on an IEEE 4-bus system simulated in Simulink. Results indicate that, when compared to using regular PSO and GSA procedures individually, the PSO-GSA technique reduces the operating time of the relay significantly.</span>