(principally nautical) In a state of collision or entanglement.
The ships’ lines and sails were all afoul.
(with of) In a state of entanglement or conflict (with).
He had a knack for running afoul of the law.