The 2-inch gas line was broken around 8:18 p.m. by construction workers near San Bruno Avenue, PG&E spokesman J.D. Guidi said.
Workers capped the gas line around 1 a.m.
The gas leak halted Caltrain in both directions, according to Caltrain spokeswoman Christine Dunn.
Northbound train 447 was stopped at Millbrae, and all passengers were transferred to BART. Southbound train 448 stopped at South San Francisco, and those passengers were taken by bus to Millbrae, where they boarded a southbound train, Dunn said.
BART accepted Caltrain tickets and SamTrans provided a bus bridge between Millbrae, San Bruno and South San Francisco.
The line was broken by a construction crew working on the San Bruno Grade Separation Project, Dunn said.
The construction is part of a $155 million project that will elevate train tracks over three streets in San Bruno. San Bruno Avenue has been closed since Friday at 5 p.m. and is scheduled to remain closed until 5 a.m. today due to the project.
No injuries or evacuations have been reported.
Caltrain expects to resume normal service in the morning, Dunn said Sunday evening.