The failure to stop unauthorised sand dredging on Lough Neagh is making a "mockery" of planning regulation in Northern Ireland, a court has heard.
The claim was made by a lawyer for Friends of the Earth who have taken a case to court.
The group wants an immediate end to sand dredging on the lough which is an important bird sanctuary with international protection.
It is appealing the decision of an earlier court not to order this.
Around 1.5m tonnes of sand a year are dredged from the bed of the lough by sand companies.
They do not have planning permission and the operation is unlawful. In 2015, the then environment minister, Mark H Durkan, issued an enforcement notice requiring work to stop within 24 hours.
But the sand companies appealed to the planning appeals commission.
Dredging is continuing pending the outcome of that appeal.
A lawyer for Friends of the Earth said Mr Durkan had not taken proper account of his officials' report which cited significant environmental impact if dredging were to continue.
The lawyer said enforcement had to be effective to comply with the protections afforded under EU law.
In this case, dredging had continued for two years after an attempt had been made to stop it.
"This is a case where you can't fill up the hole. Every time a scoop is taken it ends up in someone's patio in Enniskillen, or Liverpool.
"You can't put it back," the lawyer said.
He said the minister did not have the discretion to balance jobs in unauthorised sand extraction against potential damage to a protected area. He called on the court to stop the dredging "belatedly" as it made "a mockery of the system here".
'No ongoing evidence of harm'
Later, counsel for the department said a stop notice was an option open to the minister but not the only one.
He had decided to issue an enforcement notice and retained the power to intervene to cease dredging at a later stage if necessary.
The appeal court judges asked for evidence that Mr Durkan had factored in the potential environmental impact of the extraction in his decision to issue an enforcement notice rather than a stop notice.
The lawyer said Mr Durkan had made a measured analysis of all the issues in the case.
A lawyer for the sand traders said there was no "ongoing evidence of harm" caused by dredging.
He said they had now put in a planning application to cover future operations.
He said they rejected any suggestion that they were attempting to delay resolution of the issues nor were they "trying to get away with something".
The three appeal court judges have reserved their judgement.