Patterning of the terminal regions of the Drosophila embryo relies on the gradient of phosphorylated ERK/MAPK (dpERK), which is controlled by the localized activation of the Torso receptor tyrosine kinase [1-4]. This model is supported by a large amount of data, but the gradient itself has never been quantified. We present the first measurements of the dpERK gradient and establish a new intracellular layer of its regulation. Based on the quantitative analysis of the spatial pattern of dpERK in mutants with different levels of Torso as well as the dynamics of the wild-type dpERK pattern, we propose that the terminal-patterning gradient is controlled by a cascade of diffusion-trapping modules. A ligand-trapping mechanism establishes a sharply localized pattern of the Torso receptor occupancy on the surface of the embryo. Inside the syncytial embryo, nuclei play the role of traps that localize diffusible dpERK. We argue that the length scale of the terminal-patterning gradient is determined mainly by the intracellular module.