This paper studies a simple dynamic model of interbank credit relationships. Starting from a given balance sheet structure of a banking system with a realistic distribution of bank sizes, the necessity of establishing interbank credit connections 3merges from idiosyncratic liquidity shocks. Banks initially choose potential trading partners randomly, but form preferential relationships via an elementary reinforcement learning algorithm. As it turns out, the dynamic evolution of this system displays a formation of a core-periphery structure with mainly the largest banks assuming the roles of money center banks mediating between the liquidity needs of many smaller banks. Statistical analysis shows that this evolving interbank market shares virtually all of the salient characteristics of interbank credit relationship that have been put forthin recent literature. Preferential interest rates for borrowers with strong attachment to a lender may prevent the system from becoming extortionary and guarantee the survival of the small peripherical banks.