Anyons are exotic quasiparticles obeying fractional statistics,whose behavior can be emulated in artificially designed spin systems.Here we present an experimental emulation of creating anyonic excitations in a superconducting circuit that consists of four qubits, achieved by dynamically generating the ground and excited states of the toric code model, i.e., four-qubit Greenberger-Horne-Zeilinger states. The anyonic braiding is implemented via single-qubit rotations: a phase shift of pi related to braiding, the hallmark of Abelian 1/2 anyons, has been observed through a Ramsey-type interference measurement.