Due to relative mobility, topology changes rapidly with frequent link breakage in vehicular ad hoc networks (VANETs). Clustering VANETs into small groups limits channel contention and controls the network topology efficiently. In this study, a novel cluster-based medium access control (CB-MAC) protocol is proposed for VANETs. The cluster formation process is defined. Moreover, cluster head election and cluster merging processes are described for efficient communication in the cluster as well as out of the cluster. The mechanism defined in IEEE 802.11 standard is specially designed for only direct communications and is not suitable for cluster-based communications. Therefore, new control packets are introduced and the existing control packet format is modified to support cluster-based communications. For effective MAC protocol design, the request to send (RTS)/clear to send (CTS) mechanism is not used for safety messages which are of broadcast nature. On the other hand, the RTS/CTS mechanism is used for non-safety data delivery to eliminate hidden node problem. Markov chain model-based analytical model is presented to explore the performance of the proposed CB-MAC protocol. The proposed protocol is validated by numerical studies. The numerical results exhibit that the proposed CB-MAC protocol improves system performance and satisfies the delay constraint of 100 ms for safety messages.