Recent empirical evidence suggests that financial networks exhibit a core-periphery network structure. This paper aims at giving an explanation for the emergence of such a structure using network formation theory. We propose a simple model of the overnight interbank lending market, in which banks compete for intermediation benefits. Focusing on the role of bank heterogeneity, we find that a core-periphery network cannot be unilaterally stable when banks are homogeneous. A core-periphery network structure can form endogenously, however, if we allow for heterogeneity among banks in size. Moreover, size heterogeneity may arise endogenously if payoffs feed back into bank size.