ABSTRACT. Fix integers r, s 1 , . . . , s l such that 1 ≤ l ≤ r − 1 and s l ≥ r − l + 1, and let C(r; s 1 , . . . , s l ) be the set of all integral, projective and nondegenerate curves C of degree s 1 in the projective space P r , such that, for all i = 2, . . . , l, C does not lie on any integral, projective and nondegenerate variety of dimension i and degree < s i . We say that a curve C satisfies the flag condition (r; s 1 , . . . , s l ) if C belongs to C(r; s 1 , . . . , s l ). Define G(r; s 1 , . . . , s l ) = max {p a (C) : C ∈ C(r; s 1 , . . . , s l )} , where p a (C) denotes the arithmetic genus of C. In the present paper, under the hypothesis s 1 >> · · · >> s l , we prove that a curve C satisfying the flag condition (r; s 1 , . . . , s l ) and of maximal arithmetic genus p a (C) = G(r; s 1 , . . . , s l ) must lie on a unique flag such as C = V 1denotes an integral projective subvariety of P r of degree s i and dimension i, such that its general linear curve section satisfies the flag condition (r − i + 1; s i , . . . , s l ) and has maximal arithmetic genus G(r − i + 1; s i , . . . , s l ). This proves the existence of a sort of a hierarchical structure of the family of curves with maximal genus verifying flag conditions. Fix integers r, d, s such that s ≥ r − 1, and let C(r; d, s) be the set of all integral, projective and nondegenerate curves of degree d in the projective space P r , not contained in any integral, projective surface of degree < s. [CCD] one proves that, when d >> s, the curves of maximal arithmetic genus in C(r; d, s) are contained in surfaces of degree s, whose general hyperplane sections are themselves curves of maximal arithmetic genus in C(r − 1; s, r − 2) (the so called "Castelnuovo curves"). In the present paper we show that this property is a particular case of a more general property.In order to state our main result, we need some preliminary notation. Fix integers r, s 1 , . . . , s l such that 1 ≤ l ≤ r − 1 and s l ≥ r − l + 1, and let C(r; s 1 , . . . , s l ) be the set of all integral, projective and nondegenerate curves C of degree s 1 in the projective space P r , such that, for all i = 2, . . . , l, C does not lie on any integral, projective and nondegenerate variety of dimension i and degree < s i . We say that a curve C satisfies the flag condition (r; s 1 , . . . , s l ) if C belongs to C(r; s 1 , . . . , s l ). Notice that C(r; s 1 , r −1)