  Recently there has been much interest in studying random graph analogues of
well known classical results in extremal graph theory. Here we follow this
trend and investigate the structure of triangle-free subgraphs of $G(n,p)$ with
high minimum degree. We prove that asymptotically almost surely each
triangle-free spanning subgraph of $G(n,p)$ with minimum degree at least
$\big(\frac{2}{5} + o(1)\big)pn$ is $\mathcal O(p^{-1}n)$-close to bipartite,
and each spanning triangle-free subgraph of $G(n,p)$ with minimum degree at
least $(\frac{1}{3}+\varepsilon)pn$ is $\mathcal O(p^{-1}n)$-close to
$r$-partite for some $r=r(\varepsilon)$. These are random graph analogues of a
result by Andr\'asfai, Erd\H{o}s, and S\'os [Discrete Math. 8 (1974), 205-218],
and a result by Thomassen [Combinatorica 22 (2002), 591--596]. We also show
that our results are best possible up to a constant factor.
