Under the deal, the two countries will renovate the rail line from Russia's border town of Khasan to the North Korean port of Rajin, where sea cargo to and from South Korea could be unloaded.
North Korean leader Kim Jong-il and Russian President Vladimir Putin agreed the outlines of the project during Kim's visit to Russia in 2001. But talks with North Korea dragged on for seven years amid periodic breaks in negotiations.
Russian Railways chief Vladimir Yakunin signed the deal in Moscow with North Korean Rail Minister Kim Yong-sam.
"We have been moving towards this moment for 7 years," Yakunin said in a statement. "I am convinced that the agreement and contract signed today will serve to strengthen the economic ties between Russia and DPRK as well as between the DPRK and the Republic of Korea."
Russian officials say the rail route will provide a rare link with isolated North Korea, whose economy has been drained by supporting one of the world's largest standing armies.
Russian Railway officials in Moscow refused to say when the 54-km (34-mile) rail line would be ready or give an estimate of how much it would cost. A container terminal will be built at Rajin by a joint Russian-North Korean venture.
World powers including Russia have been trying to get Kim to abandon his nuclear arms programmes after a 2006 nuclear test.
(Reporting by Guy Faulconbridge, editing by Peter Millership)
Thank goodness China isnt the Korean peninsula's lone land neighbor.
I wondered how this railroad would be linked to Rajin, since the NK-Russian border is so narrow so here a map i print screened.