In this paper, we continue our study of the class of diagram groups. Simply speaking, a diagram is a labelled plane graph bounded by a pair of paths (the top path and the bottom path). To multiply two diagrams, one simply identifies the top path of one diagram with the bottom path of the other diagram, and removes pairs of "reducible" cells. Each diagram group is determined by an alphabet X, containing all possible labels of edges, a set of relationscontaining all possible labels of cells, and a word w over X -the label of the top and bottom paths of diagrams. Diagrams can be considered as 2-dimensional words, and diagram groups can be considered as 2-dimensional analogue of free groups. In our previous paper, we showed that the class of diagram groups contains many interesting groups including the famous R. Thompson group F (it corresponds to the simplest set of relations { x = x 2 }), closed under direct and free products and some other constructions. In this paper we study mainly subgroups of diagram groups. We show that not every subgroup of a diagram group is itself a diagram group (this answers a question from the previous paper). We prove that every nilpotent subgroup of a diagram group is abelian, every abelian subgroup is free, but even the Thompson group contains solvable subgroups of any degree. We also study distortion of subgroups in diagram groups, including the Thompson group. It turnes out that centralizers of elements and abelian subgroups are always undistorted, but the Thompson group contains distorted soluble subgroups.