A ship sails in the Baltic sea after leaving the Ferry Terminal of the Travemuende port, northern Germany, on June 22, 2013

Ferries and ships will be banned from dumping toilet waste in the Baltic Sea, one of the world's most polluted bodies of water, the International Maritime Organization said Friday.

The ban will come into force in June 2019 for new passenger ships and two years later for older vessels, the IMO said in a statement.

In 2011 the IMO's Marine Environment Protection Commission (MEPC) moved to protect the Baltic Sea by designating it a "special area", but it has taken five years to agree the ban on waste tank discharging.

Sweden's infrastructure minister Anna Johansson welcomed the decision but said she regretted how long it had taken in the face of opposition from several coastal countries.

"The negotiations were long and sometimes difficult because many countries were against it," she said, declining to name nations that had opposed the deal.

Some countries had said there was insufficient infrastructure to deal with waste in the Baltic's ports.

The ban would help to promote "more sustainable shipping" and contribute to sustainable tourism, Johansson said in a statement on the Swedish government website.

"The discharge of sewage from passenger ships within the special area will generally be prohibited under the new regulations, except when the ship has in operation an approved ," the IMO said in a statement.

Though the rules will not be compulsory straight away, the MEPC encouraged governments and industry groups to begin to comply immediately with the new guidelines.

Most scientists agree that the single biggest problem in the Baltic Sea is nitrates and phosphates from industrial agriculture, which cause the eutrophication of the bed, depleting the shallow waters of oxygen and asphyxiating plant and animal life.

Despite agreeing to an action plan in 2007 to improve conditions in the Baltic by 2021, countries in the region have largely abandoned their efforts according to environmental NGOs.