In the actual referendum , which took place on June 23 , 2016 , leave won 51.9 percent of the votes and remain 48.1 percent , after several polls in the run-up to the referendum put remain slightly ahead .