This paper proposes a distributed energy management system for community microgrids based on the new concept of transactive energy. Unlike a centralized optimization-based energy management system, such a system determines the scheduling of distributed energy resources (DERs) and energy storage systems (ESSs), as well as residential appliances, through iterative interaction between the microgrid central controller (MCC) and home energy management systems (HEMSs) installed in houses. In each iteration, the energy price curve for each bus is updated according to the unbalanced power between generation and demand and then distributed to the MCC and HEMSs on corresponding buses. Based on the updated price curves, the MCC adjusts the scheduling of DERs and ESSs at the microgrid level. Meanwhile, the HEMS of each house adjusts the scheduling of residential appliances. When the unbalanced power of all buses is close to zero, optimization converges; i.e., the MCC and HEMSs reach an agreement on the energy price and generation/consumption. In particular, the distribution network and associated operational constraints are considered in the MCC scheduling as a distribution optimal power flow problem. The detailed thermal dynamic model of a house is also integrated into the HEMS scheduling for intelligent control of the heating, ventilation, and air-conditioning system. Results of case studies validate the efficacy of the proposed distributed energy management system.