We propose a model of discrimination in the market for mortgages. The model explains accepted loan applications and determines loan sizes and interest rates simultaneously. A competitive, and a discriminating monopoly version of the model are proposed. Offered interest rates and loan sizes are a function of observable borrower characteristics. The competitive model rests on a marginal condition, re°ecting contract optimality, to which a zero-profit condition is added. In contrast, the discriminating monopoly maximizes profitsunder a borrower participation constraint, reflecting the availability of a rental market as an outside option. Each version of the model is a bivariate, nonlinear model, and is estimated by standard maximum likelihood methods. The data used for estimation is a sample of clients of a French network of mortgage lenders. We show the presence of social discrimination in the data, the loan conditions depending, not only on the borrower's wage and downpayment, but also on the borrower's occupational status. Abnormally high risk premia in the competitive version of the model suggest the presence of market power, justifying an attempt at estimating its monopolistic version. The discriminating monopoly model estimates show that the borrowers' price-elasticity of demand for housing varies with occupational status, and is inversely related with the lender's interest rate markups. This confirms that the lender exploits structural differences in the preferences to discriminate, as predicted by standard theories.