The pancreas originates from two epithelial evaginations of the foregut, which consist of multipotent epithelial progenitors that organize into a complex tubular epithelial network. The trunk domain of each epithelial branch consists of bipotent pancreatic progenitors (bi-PPs) that give rise to both duct and endocrine lineages, whereas the tips give rise to acinar cells1. Here we identify the extrinsic and intrinsic signalling mechanisms that coordinate the fate-determining transcriptional events underlying these lineage decisions1,2. Single-cell analysis of pancreatic bipotent pancreatic progenitors derived from human embryonic stem cells reveal that cell confinement is a prerequisite for endocrine specification, whereas spreading drives the progenitors towards a ductal fate. Mechanistic studies identify the interaction of extracellular matrix (ECM) with integrin α5 as the extracellular cue that cell-autonomously, via the F-actin-YAP1-Notch mechanosignalling axis, controls the fate of bipotent pancreatic progenitors. Whereas ECM-integrin α5 signalling promotes differentiation towards the duct lineage, endocrinogenesis is stimulated when this signalling cascade is disrupted. This cascade can be disrupted pharmacologically or genetically to convert bipotent pancreatic progenitors derived from human embryonic stem cells to hormone-producing islet cells. Our findings identify the cell-extrinsic and intrinsic mechanotransduction pathway that acts as gatekeeper in the fate decisions of bipotent pancreatic progenitors in the developing pancreas.