We present two transits of the hot-Jupiter exoplanet XO-2b using the Gran Telescopio Canarias ( GTC ) . The time series observations were performed using long-slit spectroscopy of XO-2 and a nearby reference star with the OSIRIS instrument , enabling differential specrophotometric transit lightcurves capable of measuring the exoplanet ’ s transmission spectrum . Two optical low-resolution grisms were used to cover the optical wavelength range from 3800 to 9300Â Ã . We find that sub-mmag level slit losses between the target and reference star prevent full optical transmission spectra from being constructed , limiting our analysis to differential absorption depths over \sim 1000 Â Ã Â regions . Wider long slits or multi-object grism spectroscopy with wide masks will likely prove effective in minimising the observed slit-loss trends . During both transits , we detect significant absorption in the planetary atmosphere of XO-2b using a 50Â Ã Â bandpass centred on the Na I doublet , with absorption depths of \Delta ( R _ { pl } / R _ { \star } ) ^ { 2 } = 0.049 \pm 0.017 % using the R500R grism and 0.047 \pm 0.011 % using the R500B grism ( combined 5.2- \sigma significance from both transits ) . The sodium feature is unresolved in our low-resolution spectra , with detailed modelling also likely ruling out significant line-wing absorption over an \sim 800Â Ã Â region surrounding the doublet . Combined with narrowband photometric measurements , XO-2b is the first hot Jupiter with evidence for both sodium and potassium present in the planet ’ s atmosphere .