The demand for compact ultraviolet laser devices is increasing, as they are essential in applications such as optical storage, photocatalysis, sterilization, ophthalmic surgery and nanosurgery. Many researchers are devoting considerable effort to finding materials with larger bandgaps than that of GaN. Here we show that hexagonal boron nitride (hBN) is a promising material for such laser devices because it has a direct bandgap in the ultraviolet region. We obtained a pure hBN single crystal under high-pressure and high-temperature conditions, which shows a dominant luminescence peak and a series of s-like exciton absorption bands around 215 nm, proving it to be a direct-bandgap material. Evidence for room-temperature ultraviolet lasing at 215 nm by accelerated electron excitation is provided by the enhancement and narrowing of the longitudinal mode, threshold behaviour of the excitation current dependence of the emission intensity, and a far-field pattern of the transverse mode.