The aim of the paper is to explore the formation of cities through labor specialization, gains to trade, a fixed cost for the transportation network, imperfect competition between firms and the commuting costs of consumers. The model uses a very general setting, allowing a multidimensional location space and multiple firms using different types of labor to produce different outputs. Locations of all agents are endogenous as are prices and quantities. Firms playa Nash location game among themselves, anticipating the locations of consumers, but taking prices as given. Within this framework, we characterize the spatial configuration of firms in equilibrium. Whether or not equilibrium exists and whether or not it is locally unique depend crucially on the relative numbers of outputs, types of labor and firms. Finally, both welfare theorems fail in this model.