  Context. Blazar AO 0235+164, located at redshift z = 0.94, has undergone
several sharp multi-spectral-range flaring episodes during the last decades. In
particular, the episodes peaking in 2008 and 2015, that received extensive
multi-wavelength coverage, exhibited interesting behavior.
  Aims. We study the actual origin of these two observed flares by constraining
the properties of the observed photo-polarimetric variability, those of the
broad-band spectral energy-distribution and the observed time-evolution
behavior of the source as seen by ultra-high resolution total-flux and
polarimetric Very-long-baseline interferometry (VLBI) imaging.
  Methods. The analysis of VLBI images allows us to constrain kinematic and
geometrical parameters of the 7 mm jet. We use the Discrete Correlation
Function to compute the statistical correlation and the delays between emission
at different spectral ranges. Multi-epoch modeling of the spectral energy
distributions allows us to propose specific models of emission; in particular
for the unusual spectral features observed in this source in the X-ray region
of the spectrum during strong multi spectral-range flares.
  Results. We find that these X-ray spectral features can be explained by an
emission component originating in a separate particle distribution than the one
responsible for the two standard blazar bumps. This is in agreement with the
results of our correlation analysis that do not find a strong correlation
between the X-rays and the remaining spectral ranges. We find that both
external Compton dominated and synchrotron self-Compton dominated models can
explain the observed spectral energy distributions. However, synchrotron
self-Compton models are strongly favored by the delays and geometrical
parameters inferred from the observations.
