This study proposes a new multi-agent control system (MACS) for energy management in a microgrid (MG). The latter includes photovoltaic arrays and wind turbine generators as renewable energy resources. It also has microturbines, fuel cell units, and an energy storage system (ESS). The MACS determines the optimal active and reactive powers of the dispatchable energy resources. It also identifies the ESS charging/discharging times. The MACS supervises energy management among local distributed generators (DGs), main grid, and loads to maximise profit while satisfying all operational constraints. The MG collaborates in the electricity market. It purchases/sells active and reactive powers from/to the main grid. Furthermore, MACS dynamically corrects the possible voltage violations and eliminates line congestion using the coordination of reactive power control. Agents at dispatchable DGs and ESS buses tackle the optimal economical operation. Other agents regulate the nodes voltages and remove line congestions. A parallel computing-based full dynamic simulation model of the MACS and the MG power system is implemented. Moreover, the performance comparisons between the proposed MACS and recent approaches are presented to evaluate the performance of MACS.