Context. The large-scale structure is a major source of cosmological information. However, next-generation photometric galaxy surveys will only provide a distorted view of cosmic structures due to large redshift uncertainties. Aims. To address the need for accurate reconstructions of the large-scale structure in presence of photometric uncertainties, we present a framework that constrains the three-dimensional dark matter density jointly with galaxy photometric redshift probability density functions (PDFs), exploiting information from galaxy clustering. Methods. Our forward model provides Markov Chain Monte Carlo realizations of the primordial and present-day dark matter density, inferred jointly from data. Our method goes beyond 2-point statistics via field-level inference. It accounts for all observational uncertainties and the survey geometry. Results. We showcase our method using mock catalogs that emulate next-generation surveys with a worst-case redshift uncertainty, equivalent to ∼300 Mpc. On scales 150 Mpc, we improve the cross-correlation of the photometric galaxy positions with the ground truth from 28% to 86%. The improvement is significant down to 13 Mpc. On scales 150 Mpc, we achieve a cross-correlation of 80 − 90% with the ground truth for the dark matter density, radial peculiar velocities, tidal shear and gravitational potential. Conclusions. We achieve accurate inferences of the large-scale structure on scales smaller than the original redshift uncertainty. Despite the large redshift uncertainty, we recover individual cosmic structures. Owing to our structure growth model, we infer plausible initial conditions of structure formation. Finally, we constrain individual photometric redshift PDFs. This work opens up the possibility to extract information at the smallest cosmological scales with next-generation photometric surveys, going beyond approaches that compress information in the data.