Quantum phase transitions play an important role in many-body systems and have been a research focus in conventional condensed-matter physics over the past few decades. Artificial atoms, such as superconducting qubits that can be individually manipulated, provide a new paradigm of realising and exploring quantum phase transitions by engineering an on-chip quantum simulator. Here we demonstrate experimentally the quantum critical behaviour in a highly controllable superconducting circuit, consisting of four qubits coupled to a common resonator mode. By off-resonantly driving the system to renormalize the critical spin-field coupling strength, we have observed a four-qubit nonequilibrium quantum phase transition in a dynamical manner; that is, we sweep the critical coupling strength over time and monitor the four-qubit scaled moments for a signature of a structural change of the system's eigenstates. Our observation of the nonequilibrium quantum phase transition, which is in good agreement with the driven Tavis-Cummings theory under decoherence, offers new experimental approaches towards exploring quantum phase transition-related science, such as scaling behaviours, parity breaking and long-range quantum correlations.