Air-conditioning (AC) systems are the major energy consumption units in residential and commercial buildings. In the context of smart grid, optimizing AC operations leads to substantial saving in energy consumption, reducing the consumer's bill and contributing to the environment by minimizing carbon emissions from generating stations. This paper presents a distributed AC energy management system for buildings by using networked master-slaves controller architecture. The proposed system was designed, simulated, and experimentally tested by using real AC units in a students' residence hall. Based on the students' class schedules, several operational scenarios were implemented and tested. The proposed system implementation leads to a 40% to 60% saving of the consumed energy by the tested units. The same energy management scheme can be applied and implemented in other commercial and residential buildings.