We argue that giant flares in SGRs can be associated to the core conversion of an isolated neutron star having a subcritical magnetic field $sim 10^{12}$ G and a fallback disk around it. We show that, in a timescale of $lesssim 10^5$ yrs, accretion from the fallback disk can increase the mass of the central object up to the critical mass for the conversion of the core of the star into quark matter. A small fraction of the neutrino-antineutrino emission from the just-converted quark-matter hot core annihilates into $e^+e^-$ pairs above the neutron star surface originating the gamma emission of the spike while the further cooling of the heated neutron star envelope originates the tail of the burst. We show that several characteristics of the giant flare of the SGR 1806-20 of 27 December 2004 (spike and tail energies, timescales, and spectra) can be explained by this mechanism.