This paper presents a spanning tree-based genetic algorithm (GA) for the reconfiguration of electrical distribution systems with the objective of minimizing active power losses. Due to low voltage levels at distribution systems, power losses are high and sensitive to system configuration. Therefore, optimal reconfiguration is an important factor in the operation of distribution systems to minimize active power losses. Smart and automated electric distribution systems are able to reconfigure as a response to changes in load levels to minimize active power losses. The proposed method searches spanning trees of potential configurations and finds the optimal spanning tree using a genetic algorithm in two steps. In the first step, all invalid combinations of branches and tie-lines (i.e., switching combinations that do not provide power to some of loads or violate the radiality and connectivity conditions) generated by initial population of GA are filtered out with the help of spanning-tree search algorithm. In the second step, power flow analyses are performed only for combinations that form spanning trees. The optimal configuration is then determined based on the amount of active power losses (optimal configuration is the one that results in minimum power losses). The proposed method is implemented on several systems including the well-known 33-node and 69-node systems. The results show that the proposed method is accurate and efficient in comparison with existing methods.