Photon counting lidar has been widely used in long-distance target detection and long range active three-dimensional imaging fields due to its extremely high detecting sensitivity. The single-photon level sensitivity extends the detection range of the photon counting lidar, meanwhile makes it suffer from the noise interference. Especially, the strong sunlight background during the daytime limits the detection ability and applications of the photon counting lidar. In this paper, a new type of ultra-narrowband spectral filtering system is designed for the lidar, and based on which, a daytime working photon counting lidar system with 20 μJ pulse energy and 25 mm receiving aperture was established. A 24 km long-distance ranging experiment and a 22 km fast 3D imaging experiment were completed in daylight environment, which demonstrated outstanding daytime working performance of such a "small" lidar.