T-lymphocyte activation displays a remarkable combination of speed, sensitivity, and discrimination in response to peptide-major histocompatibility complex (pMHC) ligand engagement of clonally distributed antigen receptors (T cell receptors or TCRs). Even a few foreign pMHCs on the surface of an antigen-presenting cell trigger effective signaling within seconds, whereas 1 x 10(5)-1 x 10(6) self-pMHC ligands that may differ from the foreign stimulus by only a single amino acid fail to elicit this response. No existing model accounts for this nearly absolute distinction between closely related TCR ligands while also preserving the other canonical features of T-cell responses. Here we document the unexpected highly amplified and digital nature of extracellular signal-regulated kinase (ERK) activation in T cells. Based on this observation and evidence that competing positive- and negative-feedback loops contribute to TCR ligand discrimination, we constructed a new mathematical model of proximal TCR-dependent signaling. The model made clear that competition between a digital positive feedback based on ERK activity and an analog negative feedback involving SH2 domain-containing tyrosine phosphatase (SHP-1) was critical for defining a sharp ligand-discrimination threshold while preserving a rapid and sensitive response. Several nontrivial predictions of this model, including the notion that this threshold is highly sensitive to small changes in SHP-1 expression levels during cellular differentiation, were confirmed by experiment. These results combining computation and experiment reveal that ligand discrimination by T cells is controlled by the dynamics of competing feedback loops that regulate a high-gain digital amplifier, which is itself modulated during differentiation by alterations in the intracellular concentrations of key enzymes. The organization of the signaling network that we model here may be a prototypic solution to the problem of achieving ligand selectivity, low noise, and high sensitivity in biological responses.