In the 0-extension problem, we are given a weighted graph with some nodes marked as terminals and a semi-metric on the set of terminals. Our goal is to assign the rest of the nodes to terminals so as to minimize the sum, over all edges, of the product of the edge's weight and the distance between the terminals to which its endpoints are assigned. This problem generalizes the multiway cut problem of Dahlhaus, Johnson, Papadimitriou, Seymour, and Yannakakis and is closely related to the metric labeling problem introduced by Kleinberg and Tardos. We present approximation algorithms for O-EXTENSION. In arbitrary graphs, we present an &Ogr;(log k)-approximation algorithm, k being the number of terminals. We also give &Ogr;(1)-approximation guarantees for weighted planar graphs. Our results are based on a natural metric relaxation of the problem, previously considered by Karzanov. It is similar in flavor to the linear programming relaxation of Garg, Vazirani, and Yannakakis for the multicut problem and similar to relaxations for other graph partitioning problems. We prove that the integrality ratio of the metric relaxation is at least c√lgk for a positive c for infinitely many k. Our results improve some of the results of Kleinberg and Tardos and they further our understanding on how to use metric relaxations.