An efficient and versatile Pd-catalyzed tandem C-N bond formation between aryl halides and primary amines is developed. The transformation allows a one-pot synthesis of phenoxazine and phenothiazine derivatives with a broad range of substitution patterns from readily available precursors.