  Let $H$ be a fixed graph on $v$ vertices. For an $n$-vertex graph $G$ with
$n$ divisible by $v$, an $H$-{\em factor} of $G$ is a collection of $n/v$
copies of $H$ whose vertex sets partition $V(G)$.
  In this paper we consider the threshold $th_{H} (n)$ of the property that an
Erd\H{o}s-R\'enyi random graph (on $n$ points) contains an $H$-factor. Our
results determine $th_{H} (n)$ for all strictly balanced $H$.
  The method here extends with no difficulty to hypergraphs. As a corollary, we
obtain the threshold for a perfect matching in random $k$-uniform hypergraph,
solving the well-known "Shamir's problem."
