This paper presents an analysis of three typical microgrid operation modes. First is the analysis of the grid-connected mode, in which the main goal is to optimize the microgrid operation (in terms of economics, carbon emissions and/or reliability) when it is connected with the main grid. Second is the analysis of the planned island mode, in which the main goal is to provide a stable and smooth transition from gridconnected to island mode while keeping both the frequency and the voltages within the required limits. Finally, the paper presents the analysis of the emergency island mode, which occurs after sudden islanding, in which the main goal is to maintain the energization of critical customers. The objectives and the operation strategies of microgrid management are different in each operation mode. This paper proposes a novel, centralized, multi-agent-based, microgrid controller architecture, which provides the coordination of all three operation modes and enables the easy configuration/combination of optimization goals that are subject to a given set of operational constraints. The microgrid controller consists of a real-time agent (responsible for closed loop control and maintenance of the system's frequency), an operation planning agent [responsible for near-term (15 minutes up to 24 hours) and short-term (1 to 7 days) optimization] and a state agent (responsible for overall monitoring, management and coordination of the other two agents). A microgrid controller with the aforementioned agents has been developed and tested. The simulation results are presented for a typical microgrid test example. the reliability of critical customers and also adding the possibility of maintaining power after widespread disturbances, such as massive blackouts or heavy storms. Additionally, the MG management system (MGMS) is mandatory for networks on small islands, isolated mines and towns, as well as for critical consumers, where long-duration outages are not acceptable and where proper sizing of the power system plays a key role. An example of wind-diesel-battery islanding MG planning and coordinate control is presented in [3].The field of MGMS is very important, and it has attracted significant attention from the scientific community in the past. A large variety of methods have been proposed for a broad scope of MGMS objectives. In [4], the author's main objective was to minimize the fuel cost during grid-connected operation while ensuring the stable operation after islanding by applying a modified Economic Dispatch (ED) algorithm. However, the paper did not consider the Unit Commitment (UC) problem, or load shedding (LS) as a resource. In [5], the authors addressed rural MGMS using multi-objective optimization to create an optimal control strategy to coordinate energy storage and diesel generators with an objective to maximize wind penetration and minimize fuel cost during grid-connected operation. This paper considered only islanded MG operation and not the UC problem or LS. The authors in refs. [6][7][8] solved the UC a...