  We analyze the most salient cosmological features of axions in extensions of
the Standard Model with a gauged anomalous extra U(1) symmetry. The model is
built by imposing the constraint of gauge invariance in the anomalous effective
action, which is extended with Wess-Zumino counterterms. These generate
axion-like interactions of the axions to the gauge fields and a gauged shift
symmetry. The scalar sector is assumed to acquire a non-perturbative potential
after inflation, at the electroweak phase transition, which induces a mixing of
the Stuckelberg field of the model with the scalars of the electroweak sector,
and at the QCD phase transition. We discuss the possible mechanisms of
sequential misalignments which could affect the axions of these models, and
generated, in this case, at both transitions. We compute the contribution of
these particles to dark matter, quantifying their relic densities as a function
of the Stuckelberg mass. We also show that models with a single anomalous U(1)
in general do not account for the dark energy, due to the presence of mixed
U(1)-SU(3) anomalies.
