In this paper we discuss final semantics for the π-calculus, a process algebra which models systems that can dynamically change the topology of the channels. We show that the final semantics paradigm, originated by Aczel and Rutten for CCS-like languages, can be successfully applied also here. This is achieved by suitably generalizing the standard techniques so as to accommodate the mechanism of name creation and the behaviour of the binding operators peculiar to the λ-calculus. As a preliminary step, we give a higher order presentation of the π-calculus using as metalanguage LF,a logical framework based on typed λ-calculus. Such a presentation highlights the nature of the binding operators and elucidates the rôle of free and bound channels. The final semantics is defined making use of this higher order presentation, within a category of hypersets.