(CNN) -- Russia and Norway signed a deal Wednesday that defines their maritime border, settling a long-running dispute that has affected commercial fishing and energy interests.
The deal comes after negotiations that lasted four decades, the state-run RIA-Novosti news agency of Russia reported.
The two countries have disputed a region in the Baltic Sea and Arctic Ocean for 40 years, the news agency said, a disagreement that "often resulted in detentions of fishing vessels."
The deal clears the way for the lifting of a 30-year moratorium on oil and gas extraction in the disputed region, RIA-Novosti reported.
Russian President Dmitry Medvedev said the treaty would "open a new page in bilateral relations," the news agency reported.
The countries signed the deal after talks between Medvedev and Norwegian Prime Minister Jens Stoltenberg in the northern Russian city of Murmansk, the news agency said.
The parliaments in both nations should "ratify the treaty simultaneously," the Russian president said, according to RIA-Novosti.