One of the defining properties of electrons is their mutual Coulomb repulsion. However, in solids this basic property may change; for example, in superconductors, the coupling of electrons to lattice vibrations makes the electrons attract one another, leading to the formation of bound pairs. Fifty years ago it was proposed that electrons can be made attractive even when all of the degrees of freedom in the solid are electronic, by exploiting their repulsion from other electrons. This attraction mechanism, termed 'excitonic', promised to achieve stronger and more exotic superconductivity. Yet, despite an extensive search, experimental evidence for excitonic attraction has yet to be found. Here we demonstrate this attraction by constructing, from the bottom up, the fundamental building block of the excitonic mechanism. Our experiments are based on quantum devices made from pristine carbon nanotubes, combined with cryogenic precision manipulation. Using this platform, we demonstrate that two electrons can be made to attract each other using an independent electronic system as the 'glue' that mediates attraction. Owing to its tunability, our system offers insights into the underlying physics, such as the dependence of the emergent attraction on the underlying repulsion, and the origin of the pairing energy. We also demonstrate transport signatures of excitonic pairing. This experimental demonstration of excitonic pairing paves the way for the design of exotic states of matter.