Xu Shaoshi, head of National Development and Reform Commission, China's top economic regulator, signed the document with Somsavat Lengsavad, deputy prime minister of Laos, at a ceremony at the Diaoyutai State Guesthouse.
The two countries have agreed to use Chinese technology and equipment to build a 418-km line that will connect Kunming, capital of southwestern China's Yunnan province, with the Lao capital city of Vientiane, according to the agreement.
The line will start in Kunming and travel southward to Jinghong and Mohan until entering Laos through the Lao border city of Boten. It will then travel past Luang Prabang and Vang Vieng before arriving in Vientiane. It will transport passengers as well as cargo.
The railway's average speed is set at 160 kph and 60 percent of the line will be bridges and tunnels. China will be responsible for 70 percent of the 40-billion-yuan ($6.27 billion) investment, while Laos will be responsible for the remainder.
Once it is operational, this line will become Laos' longest and fastest railway. Currently, the Southeast Asian nation has only one railway, which was opened in 2009 and links Vientiane with Thailand's Nong Khai.
"The project will significantly boost the socioeconomic development of Laos, improve the nation's transportation and generate a lot of jobs for local people. Of course, it will also inject new momentum into the economy of China's southwestern regions," Wang Xiaotao, deputy head of National Development and Reform Commission, told reporters at the signing ceremony.
He did not disclose when the line's construction will begin, only saying that construction of the Chinese section between Yuxi and Mohan began in January.
Earlier reports said the Lao government had decided to start construction of its section of the line around the end of this year.
The two nations began to discuss the cross-border line in 2010, but the project had not made any substantial development since then due to investment issues. The turning point took place in April 2014 when Lao Prime Minister Thongsing Thammavong visited China and talked with President Xi Jinping and Premier Li Keqiang on the railway. After that, railway authorities from both sides have speeded up their work.
Bilateral trade between China and Laos reached $3.6 billion last year, according to Somsavat Lengsavad.