The aim of this paper is to study the behavior of a three-phase inverter with an RL filter powered by a renewable energy source and connected to a grid under fault conditions. The novelty of the work lies in proposing a mathematical model which can be solved analytically. So, a comprehensive analytical solution is given, which can be used to describe the behavior of a three-phase inverter under both symmetrical and unsymmetrical faults. Firstly, a complete mathematical model of the system is given. Secondly, a control is applied for both symmetrical (three-phase faults) and unsymmetrical (one-phase and two-phase faults) conditions, making use of the positive- and negative-sequence components for the latter. Finally, a mathematical model for the whole system Is developed. The analytical approach is valid for any fault conditions, either symmetrical or unsymmetrical, which helps in the understanding of the behavior of three-phase inverters connected to a faulty grid and simplifies its study. The analytical model is validated through simulations carried out in Matlab-simulink™.