© 2015 The Authors Published by Oxford University Press on behalf of the Royal Astronomical Society. We present the detection of potassium in the atmosphere of HAT-P-1b using optical transit narrow-band photometry. The results are obtained using the 10.4-m Gran Telescopio Canarias together with the OSIRIS instrument in tunable filter imaging mode.We observed four transits, two at continuum wavelengths outside the potassium feature, at 6792 and 8844 Å, and two probing the potassium feature in the line wing at 7582.0 Å and the line core at 7664.9 Å using a 12 Å filter width (R ~ 650). The planet-to-star radius ratios in the continuum are found to be Rpl/R* = 0.1176 ± 0.0013 at 6792 Å and Rpl/R* = 0.1168 ± 0.0022 at 8844 Å, significantly lower than the two observations in the potassium line: Rpl/R* = 0.1248 ± 0.0014 in the line wing at 7582.0 Å and Rpl/R* = 0.1268 ± 0.0012 in the line core at 7664.9 Å. With a weighted mean of the observations outside the potassium feature Rpl/R* = 0.1174 ± 0.0010, the potassium is detected as an increase in the radius ratio of ΔRpl/R* = 0.0073 ± 0.0017 at 7582.0 Å and ΔRpl/R* = 0.0094 ± 0.0016 at 7664.9 Å (a significance of 4.3s and 6.1s, respectively). We hypothesize that the strong detection of potassium is caused by a large scaleheight, which can be explained by a high temperature at the base of the upper atmosphere. A lower mean molecular mass caused by the dissociation of molecular hydrogen into atomic hydrogen by the extreme ultraviolet flux from the host star may also partly explain the amplitude of our detection.