The elsewhere surmized topological origin of phase transitions is given here important evidence through the analytic study of an exactly solvable model for which both topology of submanifolds of configuration space and thermodynamics are worked out. The model is a mean-field one with a k-body interaction. It undergoes a second-order phase transition for k=2 and a first-order one for k >2 . This opens a perspective for the understanding of the deep origin of first and second-order phase transitions, respectively. In particular, a remarkable theoretical result consists of a mathematical characterization of first-order transitions. Moreover, we show that a "reduced" configuration space can be defined in terms of collective variables, such that the correspondence between phase transitions and topology changes becomes one-to-one, for this model. Finally, an unusual relationship is worked out between the microscopic description of a classical N -body system and its macroscopic thermodynamic behavior. This consists of a functional dependence of thermodynamic entropy upon the Morse indexes of the critical points (saddles) of the constant energy hypersurfaces of the microscopic 2N-dimensional phase space. Thus phase space (and configuration space) topology is directly related to thermodynamics.