  We show how in a class of models Peccei--Quinn symmetry can be realized as an
automatic consequence of a gauged $U(1)$ family symmetry. These models provide
a solution to the strong CP problem either via a massless $u$--quark or via the
DFSZ invisible axion. The local family symmetry protects against potentially
large corrections to $\overline{\theta} $ induced by quantum gravitational
effects. In a supersymmetric extension, the `$\mu$--problem' is shown to have a
natural solution in the context of gravitationally induced operators. We also
present a plausible mechanism which can explain the inter--generational mass
hierarchy in such a context.
