This paper investigates the issue of interference mitigation in wireless body area networks (BANs). Although several approaches have been proposed in BAN standard IEEE 802.15.6, they increase transmission latency or energy cost, and do not mitigate interference effectively. In order to avoid both intra- and inter-BAN interference, we present a MAC protocol with two-layer interference mitigation (2L-MAC) for BANs. Considering the QoS requirements of BANs, the proposed protocol not only avoids packet collisions but also reduces transmission delay and energy consumption in sensors. Moreover, channel switching is triggered whenever a BAN needs to acquire more bandwidth. Simulation results show that our protocol outperforms other protocols in terms of delivery rate, latency and energy saving.