This paper proposes a new hybrid control system for an AC microgrid. The system uses both centralised and decentralised strategies to optimize the microgrid energy control while addressing the challenges introduced by current technologies and applied systems in real microgrid infrastructures. The well-known 3-level control (tertiary, secondary, primary) is employed with an enhanced hierarchical design using intelligent agent-based components in order to improve efficiency, diversity, modularity, and scalability. The main contribution of this paper is dual. During normal operation, the microgrid central controller (MGCC) is designed to undertake the management of the microgrid, while providing the local agents with the appropriate constraints for optimal power flow. During MGCC fault, a peer-to-peer communication is enabled between neighbouring agents in order to make their optimal decision locally. The initial design of the control structure and the detailed analysis of the different operating scenarios along with their requirements have shown the applicability of the new system in real microgrid environments.