We use noncommutative topology to study T-duality for principal torus bundles with H-flux. We characterize precisely when there is a "classical" T-dual, i.e., a dual bundle with dual H-flux, and when the T-dual must be "non-classical," that is, a continuous field of noncommutative tori.The duality comes with an isomorphism of twisted K-theories, required for matching of D-brane charges, just as in the classical case. The isomorphism of twisted cohomology which one gets in the classical case is replaced in the non-classical case by an isomorphism of twisted cyclic homology.An important part of the paper contains a detailed analysis of the classifying space for topological T-duality, as well as the T-duality group and its action. The issue of possible non-uniqueness of T-duals can be studied via the action of the T-duality group.