Abstract We propose that the inner engine of a type I binary-driven hypernova (BdHN) is composed of Kerr black hole (BH) in a non-stationary state, embedded in a uniform magnetic field B 0 aligned with the BH rotation axis and surrounded by an ionized plasma of extremely low density of 10−14 g cm−3. Using GRB 130427A as a prototype, we show that this inner engine acts in a sequence of elementary impulses. Electrons accelerate to ultrarelativistic energy near the BH horizon, propagating along the polar axis, θ = 0, where they can reach energies of ∼1018 eV, partially contributing to ultrahigh-energy cosmic rays. When propagating with through the magnetic field B 0, they produce GeV and TeV radiation through synchroton emission. The mass of BH, M = 2.31M ⊙, its spin, α = 0.47, and the value of magnetic field B 0 = 3.48 × 1010 G, are determined self consistently to fulfill the energetic and the transparency requirement. The repetition time of each elementary impulse of energy erg is ∼10−14 s at the beginning of the process, then slowly increases with time evolution. In principle, this “inner engine” can operate in a gamma-ray burst (GRB) for thousands of years. By scaling the BH mass and the magnetic field, the same inner engine can describe active galactic nuclei.