It is accepted now that flare-like phenomena are the result of reconnection
of topologically complex magnetic fields. Observations show that such fiel
ds are often characterized by a twisted structure. This is modeled here usi
ng a force-free flux tube whose are-like body is embedded into an external
potential magnetic field. We study how the topological structure of this co
nfiguration evolves when the flux tube emerges quasistatically from below t
he photosphere to a certain height in the corona, where the tube becomes un
stable and its eruption has to occur. During this evolution below the flux
tube there appears a separator field line, along which two separatrix surfa
ces intersect. This separator is of generalized type because there are no m
agnetic nulls in the configuration. Both the separator and the separatrices
are topological features, where the connectivity of magnetic field lines s
uffers a jump. We propose that the eruption of the flux tube has to stimula
te the formation of strong current layers, in which the free magnetic energ
y of configuration is released in the form of a flare. The model predicts t
he formation of hot loops of two kinds during the reconnection phase: the l
ong loops which make nearly one turn around the twisted flux tube, and shor
t sheared loops below. The proposed model provides important clues to the m
echanism of solar flares in twisted configurations.