We show that all the tangles in a finite graph or matroid can be distinguished by a single tree-decomposition that is invariant under the automorphisms of the graph or matroid. This comes as a corollary of a similar decomposition theorem for more general combina- torial structures, which has further applications. These include a new approach to cluster analysis and image segmentation. As another illustration for the abstract theorem, we show that applying it to edge-tangles yields the Gomory-Hu theorem.