A shipping company has gone on trial accused of causing palm oil to wash up on shores in Hampshire and West Sussex.
Hayling Island, East Wittering and West Wittering beaches had to close after yellow lumps were found on 11 January.
Prosecutors at Southampton Magistrates' Court said tests showed the lumps were linked to a tanker called Pretty Time. The defence questioned the analysis.
Pretty Time Shipping, based in Singapore, denies making an illegal discharge into the sea.
The court heard how an investigation by the Maritime and Coastguard Agency discovered the tanker had off-loaded a cargo of palm oil and had been anchored off the Isle of Wight.
Prosecutor Oliver Wilmott said the ship was "at the right place at the right time with the right substance on board".
He told the court the ship had been having problems cleaning its tanks and pipes after discharging palm oil in Rotterdam and Hamburg.
He added the investigators had found lumps of palm oil on the ship when they went on board a few days later.
The prosecution alleged scientific tests linked the substance found on board with the yellow lumps of wax washed on to the beaches.
But defence barrister Ian Lawrie QC questioned that analysis.
He told the court that slop tanks on the tanker had plenty of spare capacity for waste material.
The case continues.