Russian energy giant Gazprom and German firms EON and BASF signed a deal on Thursday to build a five-billion-dollar pipeline linking Russia and Germany, at a ceremony attended by President Vladimir Putin and Chancellor Gerhard Schroeder.
The North European Gas Pipeline will allow the world's largest gas reserves to be piped directly to the western European market.
But its route has enraged Poland and Baltic countries that stand to lose out on lucrative fees because it bypasses their territory.
"This is truly a historic day," Schroeder said. "I am grateful for this strategic co-operation between Germany and Russia."
The four-billion euro (five-billion-dollar) agreement is a key plank in Schroeder's efforts to lessen Germany's dependence on oil - Russia already supplies 32 percent of Germany's energy requirements.
"Germany is securing a large part of its energy needs for decades to come thanks to Russia," Schroeder added.
Responding to the criticism from other countries, Schroeder said: "This project is not directed at anyone. But I am the German chancellor and I must defend German interests."
Putin said that Ukraine only had itself to blame if it was now worried about missing out on the benefits of the pipeline.