Welsh Government lawyers argued environmental concerns had to be balanced against other interests.

The inquiry in Newport heard the scheme would mean about 105 hectares of designated land, set aside for the protection of water invertebrates, would have to be lost.

The Gwent Levels' unique network of ditches, known as reens, were dug during Roman times and have since become a habitat for a range of rare species.

The Welsh Government has pledged to replace lost reens with new ones.

Dr Jessica Poole, of conservation body Natural Resources Wales (NRW), told the inquiry discussions between the regulator and the Welsh Government meant she was content with the proposed design of the new reens.

But she said there was no guarantee they would work, and it could be some time before they supported the aquatic insects the sites are meant to conserve.

Image copyrightGeograph/Lewis ClarkeImage caption
The Welsh Government claims the current M4 around Newport is "not fit for purpose"

Replicating a complex ecology that has developed over centuries would be "challenging", she said.

NRW said the Welsh Government had not demonstrated the project would comply with its statutory duty to promote sustainable development.

Should the alternative blue route, suggested by transport expert Prof Stuart Cole, be adopted - the motorway's impact on SSSI land would be "significantly reduced", Dr Poole said.

But the inquiry heard several issues NRW had raised in letters responding to the project's draft plans had been addressed and it was now satisfied on matters including water quality, drainage and some protected species such as otters and bats.

Morag Ellis QC, acting on behalf of the Welsh Government, said it was for Welsh ministers to balance any potential impact on SSSI land with other public interests related to the new motorway.

Claiming adverse effects were "fully mitigated for" was to apply a standard not in accordance with the law, she said.

She described the changes NRW had made to its initial objections after extensive discussions with Welsh Government as "a major step forward".