We study the Bergman complex B(M) of a matroid M: a polyhedral complex which arises in algebraic geometry, but which we describe purely combinatorially. We prove that a natural subdivision of the Bergman complex of M is a geometric realization of the order complex of the proper part of its lattice of flats. In addition, we show that the Bergman fan B˜(Kn) of the graphical matroid of the complete graph Kn is homeomorphic to the space of phylogenetic trees Tn×R. This leads to a proof that the link of the origin in Tn is homeomorphic to the order complex of the proper part of the partition lattice Πn.