Ultraviolet single-photon detector (UVSPD) provides a key tool for the applications requiring ultraweak light detection in the wavelength band. Here, we report a 4H-SiC single-photon avalanche diode (SPAD) based free-running UVSPD with ultralow afterpulse probability. We design and fabricate the 4H-SiC SPAD with a beveled mesa structure, which exhibits the characteristic of ultralow dark current. We further develop a readout circuit of passive quenching and active reset with tunable hold-off time setting to considerably suppress the afterpulsing effect. The nonuniformity of photon detection efficiency (PDE) across the SPAD active area with a diameter of ∼ 180 µm is investigated for performance optimization. The compact UVSPD is then characterized, exhibiting a typical performance of 10.3% PDE, 133 kcps dark count rate and 0.3% afterpulse probability at 266 nm. Such performance indicates that the compact UVSPD could be used for practical ultraviolet photon-counting applications.