This paper presents a framework for the coordination of distributed energy resources (DERs) and demand response (DR) for voltage and frequency support of islanded microgrids. The proposed method basically relies on extracting information from real and reactive power sensitivities at different buses for minimizing the voltage and frequency deviations of the islanded microgrid. To this aim, a new power flow procedure is adopted in which the frequency deviation appears as an additional state variable. This helps to calculate the required setpoints for the DERs as well as the amount of the demanded power curtailed through the controllable loads to meet the overall goal. The loads are classified based on their a-priori known controllability degree. To minimize the manipulated load, the most effective buses are selected based on their associated sensitivity values. In the grid-connected mode, the total operation cost is minimized, while the microgrid bus voltages are maintained within the pre-specified acceptable range. In both modes, the whole process is formulated as a multiobjective problem solved by the particle swarm optimization (PSO). The control procedure involves a series of commands for which the incident command system (ICS) is used as a secure communication structure. The performance of the proposed control framework is evaluated for the case of a typical MV microgrid in both grid-connected and islanded modes.