This paper proposes a new method for the simultaneous determination of the optimal control parameters of proportional resonant controllers and the optimal design of the output filter of a grid-tied three-phase inverter. The proposed method, based on the grey wolf optimization (GWO) algorithm, addresses both optimization problems as a single process to achieve a better system frequency response. It optimizes the unknown parameters by using a fitness function to find the best trade-off between the following fundamental terms: the harmonic attenuation rate; the power loss, through the damping resistor; and the current tracking error in the stationary frame, ensuring the system and grid stability. To validate the proposed optimization methodology, two case studies are considered with different output filter topologies with passive damping methods. The results obtained from the proposed optimization procedure were analyzed and discussed according to the fitness function terms.