We derive a sufficient condition for a sparse graph G on n vertices to contain a copy of a tree T of maximum degree at most d on (1 − )n vertices, in terms of the expansion properties of G. As a result we show that for fixed d ≥ 2 and 0 < < 1, there exists a constant c = c(d, ) such that a random graph G(n, c/n) contains almost surely a copy of every tree T on (1 − )n vertices with maximum degree at most d. We also prove that if an (n, D, λ)-graph G (i.e., a D-regular graph on n vertices all of whose eigenvalues, except the first one, are at most λ in their absolute values) has large enough spectral gap D/λ as a function of d and , then G has a copy of every tree T as above.