Power electronics based microgrids consist of a number of voltage source inverters (VSIs) operating in parallel. In this paper, the modeling, control design, and stability analysis of three-phase VSIs are derived. The proposed voltage and current inner control loops and the mathematical models of the VSIs were based on the stationary reference frame. A hierarchical control for the paralleled VSI system was developed based on three levels. The primary control includes the droop method and the virtual impedance loops, in order to share active and reactive power. The secondary control restores the frequency and amplitude deviations produced by the primary control. And the tertiary control regulates the power flow between the grid and the microgrid. Also, a synchronization algorithm is presented in order to connect the microgrid to the grid. The evaluation of the hierarchical control is presented and discussed. Experimental results are provided to validate the performance and robustness of the VSIs functionality during Islanded and grid-connected operations, allowing a seamless transition between these modes through control hierarchies by regulating frequency and voltage, main-grid interactivity, and to manage power flows between the main grid and the VSIs.