This paper describes a novel control algorithm for inverter-based distributed generators (DG) to maintain a continuous voltage and power supply for the critical and voltage sensitive loads in micro-grids when a serious fault on the grid side occurs. Based on a set of given system conditions, the proposed algorithm can automatically switch the DG inverter between the power-controlled and the voltage-controlled modes. In this paper, to develop a feasible control algorithm, some operating conditions are firstly assumed and the proposed control strategies are then addressed. The feasibility and effectiveness of the proposed control scheme are verified with comprehensive simulation studies carried out in the PSIM software environment. The simulation results confirm some merits of the proposed control method. It is worthwhile noting that the proposed control algorithm can easily be implemented using digital controllers for practical applications.