Abstract Context. The BL Lac object S5 0716+714, a highly variable blazar, underwent an impressive outburst in January 2015 (Phase A), followed by minor activity in February (Phase B). The MAGIC observations were triggered by the optical flux observed in Phase A, corresponding to the brightest ever reported state of the source in the R-band. Aims.The comprehensive dataset collected is investigated in order to shed light on the mechanism of the broadband emission. Methods. Multi-wavelength light curves have been studied together with the broadband spectral energy distributions (SEDs). The sample includes data from Effelsberg, OVRO, Metsähovi, VLBI, CARMA, IRAM, SMA, Swift-UVOT, KVA, Tuorla, Steward, RINGO3, KANATA, AZT-8+ST7, Perkins, LX-200, Swift-XRT, NuSTAR, Fermi-LAT and MAGIC. Results. The flaring state of Phase A was detected in all the energy bands, providing for the first time a multi-wavelength sample of simultaneous data from the radio band to the very-high-energy (VHE, E > 100 GeV). In the constructed SED, the Swift-XRT+NuSTAR data constrain the transition between the synchrotron and inverse Compton components very accurately, while the second peak is constrained from 0.1 GeV to 600 GeV by Fermi+MAGIC data. The broadband SED cannot be described with a one-zone synchrotron self-Compton model as it severely underestimates the optical flux in order to reproduce the X-ray to -ray data. Instead we use a two-zone model. The electric vector position angle (EVPA) shows an unprecedented fast rotation. An estimation of the redshift of the source by combined high-energy (HE, 0.1 GeV < E < 100 GeV) and VHE data provides a value of z = 0:31 ± 0:02 ± 0:05, confirming the literature value. Conclusions. The data show the VHE emission originating in the entrance and exit of a superluminal knot in and out of a recollimation shock in the inner jet. A shock-shock interaction in the jet seems responsible for the observed flares and EVPA swing. This scenario is also consistent with the SED modeling. © ESO 2018. ; We would like to thank the Instituto de Astrofisica de Canarias for the excellent working conditions at the Observatorio del Roque de los Muchachos in La Palma. The financial support of the German BMBF and MPG, the Italian INFN and INAF, the Swiss National Fund SNF, the ERDF under the Spanish MINECO (FPA2015-69818-P, FPA2012-36668, FPA2015-68378-P, FPA2015-69210-C6-2-R, FPA2015-69210-C6-4-R, FPA2015-69210-C6-6-R, AYA2015-71042-P, AYA2016-76012-C3-1-P, ESP2015-71662-C2-2-P, CSD2009-00064), and the Japanese JSPS and MEXT is gratefully acknowledged. This work was also supported by the Spanish Centro de Excelencia "Severo Ochoa" SEV-2012-0234 and SEV-2015-0548, and Unidad de Excelencia "Maria de Maeztu" MDM-2014-0369, by the Croatian Science Foundation (HrZZ) Project IP-2016-06-9782 and the University of Rijeka Project 13.12.1.3.02, by the DFG Collaborative Research Centers SFB823/C4 and SFB876/C3, the Polish National Research Centre grant UMO-2016/22/M/ST9/00382 and by the Brazilian MCTIC, CNPq and FAPERJ. The Fermi-LAT Collaboration acknowledges generous ongoing support from a number of agencies and institutes that have supported both the development and the operation of the LAT as well as scientific data analysis. These include the National Aeronautics and Space Administration and the Department of Energy in the United States, the Commissariat a l'Energie Atomique and the Centre National de la Recherche Scientifique/Institut National de Physique Nucleaire et de Physique des Particules in France, the Agenzia Spaziale Italiana and the Istituto Nazionale di Fisica Nucleare in Italy, the Ministry of Education, Culture, Sports, Science and Technology (MEXT), High Energy Accelerator Research Organization (KEK) and Japan Aerospace Exploration Agency (JAXA) in Japan, and the K. A. Wallenberg Foundation, the Swedish Research Council and the Swedish National Space Board in Sweden. Additional support for science analysis during the operations phase is gratefully acknowledged from the Istituto Nazionale di Astrofisica in Italy and the Centre National d'Etudes Spatiales in France. This research was supported by an appointment to the NASA Postdoctoral Program at the Goddard Space Flight Center, administered by Universities Space Research Association through a contract with NASA. We thank the Swift team duty scientists and science planners. ; The Metsahovi team acknowledges the support from the Academy of Finland to our observing projects (numbers 212656, 210338, 121148, and others). The VLBA is an instrument of the Long Baseline Observatory. The Long Baseline Observatory is a facility of the National Science Foundation operated by Associated Universities, Inc. The Sub-millimeter Array is a joint project between the Smithsonian Astrophysical Observatory and the Academia Sinica Institute of Astronomy and Astrophysics and is funded by the Smithsonian Institution and the Academia Sinica. The OVRO 40-m monitoring program is supported in part by NASA grants NNX08AW31G, NNX11A043G and NNX14AQ89G, and NSF grants AST-0808050 and AST-1109911. The St. Petersburg University team acknowledges support from Russian Science Foundation grant 17-12-01029. The BU group acknowledges support by NASA under Fermi Guest Investigator grant NNX14AQ58G and by NSF under grant AST-1615796. Part of this work was done with funding by the UK Space Agency. The VLBA is an instrument of the National Radio Astronomy Observatory. The National Radio Astronomy Observatory is a facility of the National Science Foundation operated under cooperative agreement by Associated Universities, Inc. The PRISM (Perkins Re-Imaging SysteM) camera at Lowell Observatory was developed by K. Janes et al. at BU and Lowell Observatory, with funding from the NSF, BU, and Lowell Observatory. This paper makes use of data obtained with the 100m Effelsberg radio-telescope, which is operated by the Max-Planck-Institut fur Radioastronomy (MPIfR) in Bonn (Germany). Part of this work is based on archival data, software or online services provided by the ASI Science Data Center (ASDC). PYRAF is a product of the Space Telescope Science Institute, which is operated by AURA for NASA. This paper is partly based on observations carried out with the IRAM 30 m. IRAM is supported by INSU/CNRS (France), MPG (Germany) and IGN (Spain). IA acknowledges support by a Ramon y Cajal grant of the Ministerio de Economia, Industria y Competitividad (MINECO) of Spain. The research at the IAA-CSIC was supported in part by the MINECO through grants AYA2016-80889-P, AYA2013-40825-P, and AYA2010-14844, and by the regional government of Andalucia through grant P09-FQM-4784. The Liverpool Telescope is operated by JMU with financial support from the UK-STFC. ; Peer Reviewed