Encapsulated few-layer InSe exhibits a remarkably high electronic quality, which is promising for the development of ultrathin-body high-mobility nanoelectronics. A decade of intense research on two-dimensional (2D) atomic crystals has revealed that their properties can differ greatly from those of the parent compound1,2. These differences are governed by changes in the band structure due to quantum confinement and are most profound if the underlying lattice symmetry changes3,4. Here we report a high-quality 2D electron gas in few-layer InSe encapsulated in hexagonal boron nitride under an inert atmosphere. Carrier mobilities are found to exceed 103 cm2 V−1 s−1 and 104 cm2 V−1 s−1 at room and liquid-helium temperatures, respectively, allowing the observation of the fully developed quantum Hall effect. The conduction electrons occupy a single 2D subband and have a small effective mass. Photoluminescence spectroscopy reveals that the bandgap increases by more than 0.5 eV with decreasing the thickness from bulk to bilayer InSe. The band-edge optical response vanishes in monolayer InSe, which is attributed to the monolayer's mirror-plane symmetry. Encapsulated 2D InSe expands the family of graphene-like semiconductors and, in terms of quality, is competitive with atomically thin dichalcogenides5,6,7 and black phosphorus8,9,10,11.