AZD9291 (Osimertinib) is highly effective in treating EGFR-mutated non-small-cell lung cancers (NSCLCs) with T790M-mediated drug resistance. Despite the remarkable success of AZD9291, its binding pose with EGFR T790M remains unclear. Here, we report unbiased, atomic-level molecular dynamics (MD) simulations in which spontaneous association of AZD9291 with EGFR kinases having WT and T790M mutant gatekeepers was observed. Simulation-generated structural models suggest that the binding pose of AZD9291 with T790M differs from its binding pose with the WT, and that AZD9291 interacts extensively with the gatekeeper residue (Met 790) in T790M but not with Thr 790 in the WT, which explains why AZD9291 binds T790M with higher affinity. The MD simulation-generated models were confirmed by experimentally determined EGFR/T790M complex crystal structures. This work may facilitate the rational design of drugs that can overcome resistance mutations to AZD9291, and more generally it suggests the potential of using unbiased MD simulation to elucidate small-molecule binding poses.