This paper presents a quantitative study of dinoflagellate cysts (dinocysts) and palynofacies of the Campanian–Danian marly succession at the village of Tattofte (western External Rif, northwestern Morocco). The paleoenvironmental and paleoclimatic interpretations, inferred from this palynologic analysis, are compared to coeval sequences of other areas in the Northern Hemisphere. Changes in the relative abundances of dinocyst taxa, which are paleoenvironmental indicators, throughout the section suggest a deposition in a marine inner to outer neritic setting. The upper Campanian dinocyst assemblage is characterized by the presence of outer neritic-oceanic and low productivity indicator taxa (e.g., Spiniferites spp., Odontochitina spp.) and cold-water taxa (e.g., Manumiella spp., Chantangiella spp., Laciniadinium spp.), whereas, the lower Maastrichtian assemblage is characterized by inner neritic, high productivity and warm-water indicator taxa (e.g., Palaeocystodinium spp., Andalusiella spp.). The upper Maastrichtian dinocyst assemblage displays a return to an outer neritic environment under a transgressive regime, but with a cooling pulse and a moderate productivity. However, the Cretaceous–Paleogene (K/Pg) boundary interval records remarkable changes in the relative abundances of dinocyst taxa, indicating an inner neritic (coastal) setting, which is the most proximal in the study section; such changes reflect instable paleoenvironmental conditions which may be related to global cooling periods, likely caused by the Deccan volcanism in India and/or the Chicxulub asteroid impact in Mexico at the K/Pg boundary. In the Danian, the dinocyst relative abundances indicate a gradual return to stable environmental conditions.A quantitative analysis of the kerogen plots (palynomorphs, phytoclasts and amorphous organic matter (AOM)) reveals five types of palynofacies, generally indicating oxic to suboxic marine environments. The upper Campanian and upper Maastrichtian (lowermost part) strata are characterized by a playnofacies (V), indicating a distal shelf, while the lower Maastrichtian and lower Danian (uppermost part) strata record a playnofacies (III), reflecting an intermediate inner-outer neritic environment. However, the K/Pg boundary transition is characterized by playnofacies types (I) and (II), indicating a proximal (coastal) environment.