G-protein-coupled receptors (GPCRs) are membrane proteins with critical functions in cellular signal transduction, representing a primary class of drug targets. Acting by direct binding, many drugs modulate GPCR activity and influence the signaling pathways associated with numerous diseases. However, complete details of ligand-dependent GPCR activation/deactivation are difficult to obtain from experiments. Therefore, it remains unclear how ligands modulate a GPCR's activity. To elucidate the ligand-dependent activation/deactivation mechanism of the human adenosine A2A receptor (AA2AR), a member of the class A GPCRs, we performed large-scale unbiased molecular dynamics and metadynamics simulations of the receptor embedded in a membrane. At the atomic level, we have observed distinct structural states that resemble the active and inactive states. In particular, we noted key structural elements changing in a highly concerted fashion during the conformational transitions, including six conformational states of a tryptophan (Trp246(6.48)). Our findings agree with a previously proposed view that, during activation, this tryptophan residue undergoes a rotameric transition that may be coupled to a series of coherent conformational changes, resulting in the opening of the G-protein binding site. Further, metadynamics simulations provide quantitative evidence for this mechanism, suggesting how ligand binding shifts the equilibrium between the active and inactive states. Our analysis also proposes that a few specific residues are associated with agonism/antagonism, affinity, and selectivity, and suggests that the ligand-binding pocket can be thought of as having three distinct regions, providing dynamic features for structure-based design. Additional simulations with AA2AR bound to a novel ligand are consistent with our proposed mechanism. Generally, our study provides insights into the ligand-dependent AA2AR activation/deactivation in addition to what has been found in crystal structures. These results should aid in the discovery of more effective and selective GPCR ligands.