Aims. Short phases of coeval powerful starburst and AGN activity during the lifetimes of the most massive galaxies are predicted by various models of galaxy formation and evolution. In spite of their recurrence and high luminosity, such events are rarely observed. Finding such systems, understanding their nature, and constraining their number density can provide key constraints to galaxy evolutionary models and insights into the interplay between starburst and AGN activities. Methods. We report the discovery of two sources at z = 3.867 and z = 3.427 that exhibit both powerful starburst and AGN activities. They benefit from multi-wavelength data from radio to X rays from the CFHTLS-D1/SWIRE/XMDS surveys. Follow-up optical and near-infrared spectroscopy, and millimeter IRAM/MAMBO observations are also available. We performed a multi-wavelength analysis of their spectral energy distributions with the aim of understanding the origin of their emission and constraining their luminosities. A comparison with other composite systems at similar redshifts from the literature is also presented. Results. The AGN and starburst bolometric luminosities are ∼1013 L . The AGN emission dominates at X ray, optical, mid-infrared wavelengths, and probably also in the radio. The starburst emission dominates in the far-infrared. The estimated star formation rates range from 500 to 3000 M /yr. The AGN near-infrared and X ray emissions are heavily obscured in both sources with an estimated dust extinction A V ≥ 4, and Compton-thick gas column densities. The two sources are the most obscured and most luminous AGNs detected at millimeter wavelengths currently known. Conclusions. The sources presented in this work are heavily obscured QSOs, but their properties are not fully explained by the standard AGN unification model. In one source, the ultraviolet and optical spectra suggest the presence of outflowing gas and shocks, and both sources show emission from hot dust, most likely in the vicinity of the nucleus. Evidence of moderate, AGN-driven radio activity is also found in both sources. Based on the estimated stellar and black hole masses, the two sources lie on the local M BH −M bulge relation. To remain on this relation as they evolve, their star formation rate has to decrease or stop. Our results support evolutionary models that invoke radio feedback such as the star formation quenching mechanism, and suggest that such a mechanism might play a major role also in powerful AGNs.