African and Asian migrants working on Irish fishing trawlers are to be given new immigration rights to protect them from trafficking and modern slavery.

Non-EEA fishing workers will no longer be tied to employers and will be able to leave a boat to find other work without fear of deportation under a new immigration agreement between the Irish government and the International Transport Workers’ Federation (ITF), the Guardian has learned.

The deal, concluded to stave off litigation, comes after the ITF took the unprecedented step of taking the Irish government to the high court in Dublin for facilitating modern slavery with its permit scheme for fishing workers from outside the European Economic Area (EEA) last year.

Boat owners will no longer be able to deduct the typical fee of €1,000 (£865) for permits from their wages. The government has also pledged to introduce new statutory instruments to bolster regulations on pay, maximum hours of work, minimum hours of rest, and minimum safe numbers of crew. Workers who are exploited will be able to claim compensation as well as unpaid wages.

The permit scheme in question was introduced in response to a Guardian investigation that uncovered persistent allegations of trafficking and severe exploitation of migrant workers in the Irish fleet in 2015. Under the scheme, boat owners were given a legal route to acquire visas for hundreds of foreign crew members who had previously been brought in and employed illegally as cheap labour. However, the scheme tied workers to individual employers, leaving many vulnerable to abusive conditions and in fear of deportation if they complained or wanted to leave.

The ITF collected testimony for the court from dozens of Ghanaian, Egyptian and Filipino migrant workers that showed that under the permit scheme some trawler companies were still paying a fraction of the legal minimum wage, and were regularly requiring migrants to work dangerously long hours without sleep, resulting in repeated cases of industrial injury.

The Garda National Immigration Bureau’s anti-trafficking unit has formally identified 26 men as suspected victims of modern slavery in the Irish fishing fleet in the last year.

The government initially contested the case but sought to settle it at the beginning of April before trial. Its climbdown comes amid concern that the US state department was about to downgrade Ireland’s ranking in its annual Trafficking in Persons (TIP) report for failing to do enough to tackle modern slavery, the Guardian understands. Ireland was downgraded from a tier one country to a tier two country in the 2018 report.

Any further downgrading would have been unprecedented for an advanced economy and highly embarrassing for the government. The TIP report is the main diplomatic lever used by the US to get governments to act on modern slavery; downgraded countries can lose preferential trading status with the US.

An exceptional rebuke from four UN rapporteurs in February, warning that the permit scheme breached international human rights law, added to pressure on the Irish government.

Ken Fleming, the ITF’s coordinator for the UK and Ireland, welcomed the deal but said the industry was unlikely to change unless the state enforced labour rights vigorously. “Migrants on trawlers here are working up to 20 hours a day and are paid as though they were working eight,” he said. “Rules designed to protect them go unenforced. I’m happy that the state has finally accepted that there is a problem but we will continue to monitor it.”

The Irish government has been approached for comment.