The reported anomaly in deep-inelastic scattering at HERA has revived interest in the phenomenology of R-parity violation. From the theoretical point of view, the existence of R-violating interactions poses two considerable problems. The first one concerns the flavour structure of the interactions and the origin of an appropriate suppression of flavour-changing neutral-current processes and lepton-family transitions. The second one concerns the way of embedding R-violating interactions in a grand unified theory (GUT) without introducing unacceptable nucleon decay rates. We show that the second problem can be solved by a mechanism which is purely group theoretical and does not rely on details of the flavour theory. We construct explicit GUT models in which our mechanism can be realized. (C) 1997 Elsevier Science B.V.