As an independent unit, microgrid operator (MGO) should respond to the energy demand of customers with an optimal provision cost. Apart from the ability to guarantee the security of microgrid (MG) operation, the MGO should consider the greenhouse emission effects as well. This paper investigates a novel energy management system for an islanded MG. In the proposed strategy, two efficient methodologies are used to maximize the profit and security of the MG: (a) the optimal operation of electric vehicles (EVs) in vehicle-togrid (V2G) mode and (b) the use of demand response (DR) program. Besides, a hierarchical control structure is proposed to manage frequency and voltage uncertainties in a permissible range. Improving the reliability of the MG is another goal of the proposed strategy, which is pursued by the studied controlling framework. The proposed approach is evaluated through a set of simulation and GAMS tests. Results indicate that the frequency deviation of the MG is damped through the proposed management strategy and place the spotlight on the effectiveness of the approach.