In this paper we first develop a theory of almost automorphicfunctions with values in Frechet spaces. Then, we consider thesemilinear differential equation x'(t) = A x(t) + f(t, x(t)), t ∈ ℝ in a Frechet space X, where A is the infinitesimal generator of a C0-semigroup satisfying some conditions of exponential stability. Under suitable conditions on f, we prove the existence and uniqueness of an almost automorphic mild solution to the equation.