The present study investigated the electropharmacological effects of a traditional Chinese herbal drug, berberine, on the spontaneous activity of sinoatrial nodes (SANs) of the rabbit heart and on human hyperpolarization-activated cyclic nucleotide-gated 4 (hHCN4) channels, which are heterologously expressed in xenopus oocytes, and which contribute to pacemaker currents (Ifs). A standard microelectrode technique and standard two‑electrode voltage‑clamp recordings were employed to examine the properties of transmembrane potentials and cloned hHCN4 subunit currents, respectively, under control conditions and berberine administration. Berberine decreased the rate of pacemaker firing and the rate of diastolic depolarization, and modified the action potential parameters. In addition, berberine suppressed the hHCN4 channel currents in a concentration‑ (1‑300 µM) and use‑dependent manner, and simultaneously decreased the activation and deactivation kinetics of the hHCN4 channels. The ability of berberine to modulate the If of cardiac pacemaker cells may contribute to its antiarrhythmic action.