Khun Tan Tunnel is a long tunnel across the Khun Tan Range. It is the longest of Thailand's seven railway tunnels. The Khun Tan Tunnel is 1352.10 metres long, and situated between kilometre 681.57870 and 682.94080 on the Northern line from Bangkok to Chiang Mai, between Mae Tan Noi, Wiang Tan, and Khun Tan stations. The tunnel runs under the boundary between Lampang and Lamphun provinces. Khun Tan Station, located at the northern end of the tunnel, is the highest railway station in Thailand at an elevation of 758 m above sea level.
Historically the Khun Tan Range was a formidable natural barrier between the Lanna Kingdom and the Central Plain of Siam. The Khun Tan Tunnel was built in 1907 across the southern part of the range and contributed to alleviate the difficulties in communication between the cities of Bangkok and Chiang Mai.
The tunnel took eleven years to complete. Construction was disrupted owing to the arrest of the German engineers in World War I. Originally the tunnel had been intended for standard gauge, therefore there is extra space inside the tunnel after having been regauged into meter gauge.