Spontaneous rhythmic action potential or pacemaking activity of pacemaker cells controls rhythmic signaling such as heartbeat. The mechanism underlying the origin of pacemaking activity is not well understood. In this study, we created human embryonic kidney (HEK) 293 cells that show pacemaking activity through heterologous expression of strong inward rectifier K subfamily 2 isoform 1 (Kir2.1) channels, hyperpolarization-activated cyclic nucleotide-gated isoform 2 (HCN2) nonselective cation channels, and voltage-gated Na subfamily 1 isoform 5 or Ca subfamily 3 isoform 1 (Na1.5 or Ca3.1) channels. A range of relative levels of Kir2.1 and HCN2 currents dynamically counterbalance, generating spontaneous rhythmic oscillation of resting membrane potential between -64 and -34 mV and determining oscillation rates. Each oscillation cycle begins with an autodepolarization phase, which slowly proceeds to the threshold potential that activates Na1.5 or Ca3.1 channels and triggers action potential, causing engineered HEK293 cells to exhibit pacemaking activity at a rate of ≤67 beats/min. Engineered HEK293 cells with Kir2.1 and either HCN3 or HCN4 also show the oscillation. Engineered HEK293 cells expressing HCN2 and other Kir2 channels, which lack Kir2.1-like complete inward rectification, do not show the oscillation. Therefore, Kir2.1-like inward rectification-controlled precise and dynamic balances between Kir2 and HCN currents initiate spontaneous rhythmic action potential and form an origin of pacemaking activity; Kir2 and HCN channels play essential roles in pacemaking activity.-Chen, K., Zuo, D., Wang, S.-Y. Chen, H. Kir2 inward rectification-controlled precise and dynamic balances between Kir2 and HCN currents initiate pacemaking activity.