In animals with binocular vision, retinal ganglion cell (RGC) axons either cross or avoid the midline at the optic chiasm. Here, we show that ephrin-Bs in the chiasm region direct the divergence of retinal axons through the selective repulsion of a subset of RGCs that express EphB1. Ephrin-B2 is expressed at the mouse chiasm midline as the ipsilateral projection is generated and is selectively inhibitory to axons from ventrotemporal (VT) retina, where ipsilaterally projecting RGCs reside. Moreover, blocking ephrin-B2 function in vitro rescues the inhibitory effect of chiasm cells and eliminates the ipsilateral projection in the semiintact mouse visual system. A receptor for ephrin-B2, EphB1, is found exclusively in regions of retina that give rise to the ipsilateral projection. EphB1 null mice exhibit a dramatically reduced ipsilateral projection, suggesting that this receptor contributes to the formation of the ipsilateral retinal projection, most likely through its repulsive interaction with ephrin-B2.