Two-dimensional materials are known to harbour properties very different from those of their bulk counterparts. Recent years have seen the rise of atomically thin superconductors, with a caveat that superconductivity is strongly depleted unless enhanced by specific substrates, intercalants or adatoms. Surprisingly, the role in superconductivity of electronic states originating from simple free surfaces of two-dimensional materials has remained elusive to date. Here, based on first-principles calculations, anisotropic Eliashberg theory, and angle-resolved photoemission spectroscopy (ARPES), we show that surface states in few-monolayer MgB2 make a major contribution to the superconducting gap spectrum and density of states, clearly distinct from the widely known, bulk-like sigma-and pi-gaps. As a proof of principle, we predict and measure the gap opening on the magnesium-based surface band up to a critical temperature as high as similar to 30 K for merely six monolayers thick MgB2. These findings establish free surfaces as an unavoidable ingredient in understanding and further tailoring of superconductivity in atomically thin materials.