The organizer at the midbrain-hindbrain boundary (MHB) forms at the interface between Otx2 and Gbx2 expressing cell populations, but how these gene expression domains are set up and integrated with the remaining machinery controlling MHB development is unclear. Here we report the isolation, mapping, chromosomal synteny and spatiotemporal expression of gbx1 and gbx2 in zebrafish. We focus in particular on the expression of these genes during development of the midbrain-hindbrain territory. Our results suggest that these genes function in this area in a complex fashion, as evidenced by their highly dynamic expression patterns and relation to Fgf signaling. Analysis of gbx1 and gbx2 expression during formation of the MHB in mutant embryos for pax2.1, fgf8 and pou2 (noi, ace, spg), as well as Fgf-inhibition experiments, show that gbx1 acts upstream of these genes in MHB development. In contrast, gbx2 activation requires ace (fgf8) function, and in the hindbrain primordium, also spg (pou2). We propose that in zebrafish, gbx genes act repeatedly in MHB development, with gbx1 acting during the positioning period of the MHB at gastrula stages, and gbx2 functioning after initial formation of the MHB, from late gastrulation stages onwards. Transplantation studies furthermore reveal that at the gastrula stage, Fgf8 signals from the hindbrain primordium into the underlying mesendoderm. Apart from the general involvement of gbx genes in MHB development reported also in other vertebrates, these results emphasize that early MHB development can be divided into multiple steps with different genetic requirements with respect to gbx gene function and Fgf signaling. Moreover, our results provide an example for switching of a specific gene function of gbx1 versus gbx2 between orthologous genes in zebrafish and mammals.