We have studied the folding mechanism of lattice model 36-mer proteins. Using a simulated annealing procedure in sequence space, we have designed sequences to have sufficiently low energy in a given target conformation, which plays the role of the native structure in our study. The sequence design algorithm generated sequences for which the native structures is a pronounced global energy minimum. Then, designed sequences were subjected to lattice Monte Carlo simulations of folding. In each run, starting from a random coil conformation, the chain reached its native structure, which is indicative that the model proteins solve the Levinthal paradox. The folding mechanism involved nucleation growth. Formation of a specific nucleus, which is a particular pattern of contacts, is shown to be a necessary and sufficient condition for subsequent rapid folding to the native state. The nucleus represents a transition state of folding to the molten globule conformation. The search for the nucleus is a rate-limiting step of folding and corresponds to overcoming the major free energy barrier. We also observed a folding pathway that is the approach to the native state after nucleus formation; this stage takes about 1% of the simulation time. The nucleus is a spatially localized substructure of the native state having 8 out of 40 native contacts. However, monomers belonging to the nucleus are scattered along the sequence, so that several nucleus contacts are long-range while other are short-range. A folding nucleus was also found in a longer chain 80-mer, where it also constituted 20% of the native structure. The possible mechanism of folding of designed proteins, as well as the experimental implications of this study is discussed.