The generation of the pancreas and small intestine from the embryonic gut depends on intercellular signalling between the endodermal and mesodermal cells of the gut. In particular, the differentiation of intestinal mesoderm into smooth muscle has been suggested to depend on signals from adjacent endodermal cells. One candidate mediator of endodermally derived signals in the embryonic hindgut is the secreted protein Sonic hedgehog (Shh). The Shh gene is expressed throughout the embryonic gut endoderm with the exception of the pancreatic bud endoderm, which instead expresses high levels of the homeodomain protein Ipf1/Pdx1 (insulin promoter factor 1/pancreatic and duodenal homeobox 1), an essential regulator of early pancreatic development. Here, we have examined whether the differential expression of Shh in the embryonic gut tube controls the differentiation of the surrounding mesoderm into specialised mesoderm derivatives of the small intestine and pancreas. To test this, we used the promoter of the Ipf1/Pdx1 gene to selectively express Shh in the developing pancreatic epithelium. In Ipf1/Pdx1-Shh transgenic mice, the pancreatic mesoderm developed into smooth muscle and interstitial cells of Cajal, characteristic of the intestine, rather than into pancreatic mesenchyme and spleen. Also, pancreatic explants exposed to Shh underwent a similar program of intestinal differentiation. These results provide evidence that the differential expression of endodermally derived Shh controls the fate of adjacent mesoderm at different regions of the gut tube.