Transcription factors (TFs) pattern developing tissues and determine cell fates; however, how spatio-temporal TF gradients are generated is ill defined. Here we show that miR-335 fine-tunes TF gradients in the endoderm and promotes mesendodermal lineage segregation. Initially, we identified miR-335 as a regulated intronic miRNA in differentiating embryonic stem cells (ESCs). miR-335 is encoded in the mesoderm-specific transcript (Mest) and targets the 3'-UTRs of the endoderm-determining TFs Foxa2 and Sox17. Mest and miR-335 are co-expressed and highly accumulate in the mesoderm, but are transiently expressed in endoderm progenitors. Overexpression of miR-335 does not affect initial mesendoderm induction, but blocks Foxa2- and Sox17-mediated endoderm differentiation in ESCs and ESC-derived embryos. Conversely, inhibition of miR-335 activity leads to increased Foxa2 and Sox17 protein accumulation and endoderm formation. Mathematical modeling predicts that transient miR-335 expression in endoderm progenitors shapes a TF gradient in the endoderm, which we confirm by functional studies in vivo. Taken together, our results suggest that miR-335 targets endoderm TFs for spatio-temporal gradient formation in the endoderm and to stabilize lineage decisions during mesendoderm formation.