  The ejecta composition is an open question in gamma-ray bursts (GRB) physics.
Some GRBs possess a quasi-thermal spectral component in the time-resolved
spectral analysis, suggesting a hot fireball origin. Others show a featureless
non-thermal spectrum known as the "Band" function, consistent with a
synchrotron radiation origin and suggesting that the jet is
Poynting-flux-dominated at the central engine and likely in the emission region
as well. There are also bursts showing a sub-dominant thermal component and a
dominant synchrotron component suggesting a likely hybrid jet composition. Here
we report an extraordinarily bright GRB 160625B, simultaneously observed in
gamma-rays and optical wavelengths, whose prompt emission consists of three
isolated episodes separated by long quiescent intervals, with the durations of
each "sub-burst" being $\sim$ 0.8 s, 35 s, and 212 s, respectively. Its high
brightness (with isotropic peak luminosity L$_{\rm p, iso}\sim 4\times 10^{53}$
erg/s) allows us to conduct detailed time-resolved spectral analysis in each
episode, from precursor to main burst and to extended emission. The spectral
properties of the first two sub-bursts are distinctly different, allowing us to
observe the transition from thermal to non-thermal radiation between
well-separated emission episodes within a single GRB. Such a transition is a
clear indication of the change of jet composition from a fireball to a
Poynting-flux-dominated jet.
