The fitness effects of mutations can depend on the genetic backgrounds in which they occur and thereby influence future opportunities for evolving populations. In particular, mutations that fix in a population might change the selective benefit of subsequent mutations, giving rise to historical contingency. We examine these effects by focusing on mutations in a key metabolic gene, pykF, that arose independently early in the history of 12 Escherichia coli populations during a long-term evolution experiment. Eight different evolved nonsynonymous mutations conferred similar fitness benefits of ~10% when transferred into the ancestor, and these benefits were greater than the one conferred by a deletion mutation. By contrast, the same mutations had highly variable fitness effects, ranging from about 0 to 25%, in evolved clones isolated from the populations at 20,000 generations. Two mutations that were moved into these evolved clones conferred similar fitness effects in a given clone, but different effects between the clones, indicating epistatic interactions between the evolved pykF alleles and the other mutations that had accumulated in each evolved clone. We also measured the fitness effects of six evolved pykF alleles in the same populations in which they had fixed, but at seven time points between 0 and 50,000 generations. Variation in fitness effects was high at intermediate time points, and declined to a low level at 50,000 generations, when the mean fitness effect was lowest. Our results demonstrate the importance of genetic context in determining the fitness effects of different beneficial mutations even within the same gene