This paper constructs a theory of the coexistence of fixed-term and permanent employment contracts in an environment with ex-ante identical workers and employers. Workers under fixed-term contracts can be dismissed at no cost while permanent employees enjoy labor protection. In a labor market characterized by search and matching frictions, firms find it optimal to discriminate by offering some workers a fixedterm contract while offering other workers a permanent contract. Match-specific quality between a worker and a firm determines the type of contract offered. We analytically characterize the firm's hiring and firing rules. Using matched employer-employee data from Canada, we estimate the model's parameters. Increasing the level of firing costs increases wage inequality and decreases the unemployment rate. The increase in inequality results from a larger fraction of temporary workers and not from an increase in the wage premium earned by permanent workers.