This paper develops a novel methodology for optimal control of islanded microgrids (MGs) based on the coot bird metaheuristic optimizer (CBMO). To this end, the optimum gains for the PI controller are found using the CBMO under a multi-objective optimization framework. The Response Surface Methodology (RSM) is incorporated into the developed procedure to achieve a compromise solution among the different objectives. To prove the effectiveness of the new proposal, a benchmark MG is tested under various scenarios, 1) isolate the system from the grid (autonomous mode), 2) islanded system exposure to load changes, and 3) islanded system exposure to a 3 phase fault. Extensive simulations are performed to validate the new method taking conventional data from PSCAD/EMTDC software. The validity of the suggested optimizer is proved by comparing its results with that achieved using the LMSRE-based adaptive control, sunflower optimization algorithm (SFO), Ziegler-Nichols method and the particle swarm optimization (PSO) techniques. The article shows the superiority of the suggested CBMO over the LMSRE-based adaptive control, SFO, Ziegler-Nichols and the PSO techniques in the transient responses of the system.