This paper presents the design, implementation and performance evaluation of a hybrid MAC protocol, called Z-MAC, for wireless sensor networks that combines the strengths of TDMA and CSMA while offsetting their weaknesses. Like CSMA, Z-MAC achieves high channel utilization and lowlatency under low contention and like TDMA, achieves high channel utilization under high contention and reduces collision among two-hop neighbors at a low cost. A distinctive feature of Z-MAC is that its performance is robust to synchronization errors, slot assignment failures and timevarying channel conditions; in the worst case, its performance always falls back to that of CSMA. Z-MAC is implemented in TinyOS. Categories and Subject Descriptors: B.2.1 [ComputerCommunication Networks]: Network Protocols, Wireless Communications General Terms: Algorithms, Design, Performance