The Baltic states and Poland have signed an agreement to connect their power grids to the European Union network by 2025 in a bid to end their dependence on Russia dating back to the Soviet era.

The leaders of Estonia, Latvia, Lithuania, and Poland, which are all EU member states, sealed the long-awaited deal on the sidelines of an EU summit in Brussels on June 28, along with EU Commission President Jean-Claude Juncker.

The Baltic states were once ruled from Moscow but have been EU and NATO members since 2004.

They have expressed concerns that continued links to Russia's power grid network was a threat to their national security.

The Baltic states and Poland took nine years to finalize the accord, with disagreements over technical aspects holding up an agreement.

The Baltic states will use the existing overland LitPol Link between Lithuania and Poland, along with a proposed cable to run under the Baltic Sea, bypassing the territorial waters of Russia's Kaliningrad exclave.

The EU has pledged to provide 1 billion euros ($1.2 billion) in funding for the project.

Lithuanian President Dalia Grybauskaite told LRT television that "this is the last millstone tied to our feet, keeping us from real energy independence."

"That tool of blackmail, which was used [by Russia] to buy our politicians and meddle in our politics, will no longer exist," she added.

In the past years, Lithuania and Poland have built terminals to import cargoes of liquefied natural gas from oversees, including the United States, reducing their reliance on Russia.

Based on reporting by Reuters and ERR.ee