It is a landmark deal that has been more than two decades in the making.\r\nRussia, Iran, Azerbaijan, Kazakhstan and Turkmenistan - all bordering the Caspian Sea - have agreed in principle on how to divide it up.\r\nTheir leaders signed the Convention on the Legal Status of the Caspian Sea in the Kazakh city of Aktau on Sunday.\r\nIt establishes a formula for dividing up its resources and prevents other powers from setting up a military presence there.\r\nIt is an important step in the easing of regional tensions, but the deal over the world's largest inland body of water matters for several reasons.\r\nHere's what you need to know about the hotly disputed Caspian Sea.\r\n1. Its legal status has been complicated\r\nIt would be reasonable to assume that the Caspian Sea is, well, a sea. But at the heart of this long-running dispute is whether or not the 370,000 sq km (143,000 sq mile) body of landlocked water should be considered a lake.\r\nUntil the dissolution of the Soviet Union (USSR) in 1991, that's what it was known as and shared between the USSR and Iran.\r\nBut the arrival on the scene of new countries complicated this issue, with ensuing claim and counterclaim.\r\nIran had argued it was a lake and not a sea, but none of the four other countries agreed.\r\nWhy is the difference so important?\r\nIf it was treated as a sea, then it would be covered by international maritime law, namely\u00a0the United Nations Law of the Sea.\r\nThis binding document sets rules on how countries can use the world's oceans. It covers areas such as the management of natural resources, territorial rights, and the environment. And it is not limited to littoral states, meaning others can seek access to its resources.\r\nBut if it is defined as a lake, then it would have to be divided equally between all five countries.\r\nSunday's agreement goes some way to settling this dispute.\r\nThe signed convention gives the body of water a "special legal status" which means it is not defined as a sea or a lake, Russian officials said.\r\nThe surface water will be in common usage, meaning freedom of access for all littoral states beyond territorial waters.\r\nBut the seabed - which is rich in natural resources - will be divided up.\r\n3. Who wins and who loses?\r\nIt's difficult to say, as the final text of the deal is yet to be published.\r\nAnother key factor is that seabed boundaries are yet to be negotiated (although now it's the subject of bilateral agreements - not multilateral as before).\r\nBut because the deal does not define the Caspian as a lake, Iran - which has the smallest coastline - is viewed as a potential loser.\r\nIranian social media users have accused the government in Tehran of "selling off" the Caspian Sea on Sunday.\r\nHowever, Iran - which is currently under growing political and economic pressure from the West - might see some political benefits in securing the clause that bars any armed presence on the Caspian other than that of the five littoral states.\r\nHad the Caspian been defined as a lake, Azerbaijan and Kazakhstan - who have established an early claim over large areas of the Caspian - stood to lose out under such a split.\r\nSo the basis of all previous disagreements stems from who gets access to what. This is important because...\r\n3. It is rich in oil and gas\r\nThe Caspian Sea is highly-prized for its vast oil and gas reserves.\r\nIt's estimated there are 50 billion barrels of oil and nearly 300 trillion cubic feet (8.4 trillion cubic metres) of natural gas beneath its seabed.\r\nIn 2002, a survey found that the fish was rapidly disappearing\u00a0and could soon become extinct.\r\nIt also found an abnormally large proportion of young sturgeon in comparison to more mature fish which produce the eggs used to make caviar.\r\nIn response, various bans on sturgeon fishing in the Caspian Sea and on the caviar trade more generally have been introduced.\r\nSignificantly, Kazakh President Nursultan Nazarbayev said on Sunday that the recent agreement allowed the setting of national quotas for fishing.\r\n5. Pollution is a major problem\r\nThe Caspian Sea has long suffered pollution from oil extraction and other industries.\r\nOil pollution has affected the migration routes of sturgeon, according to the UN's Caucasus Environment Outlook.\r\nIt says sturgeon swim through highly polluted water near Azerbaijan's Absheron Peninsula - and that is believed to limit their food and oxygen.\r\nA more recent concern is bacterial pollution caused by sewage from Iran, which is adding to the threats facing sturgeon fish.\r\nThe Caspian Sea's disputed legal status was also a risk factor for the environment - as no enforcement would have been possible to deal with a major oil spill or other pollution incident in disputed waters.