We argue that contemporary magnetic fields in the radiative cores of solar-
type stars are relics of hydromagnetic dynamos operating over the pre-main
sequence epoch when the core formed. Simulations of differential rotation a
nd dynamos of a 1 M. star are performed for a sequence of evolutionary stag
es of the core-growth epoch. A big difference in the dynamo-generated field
between the initial and final stages of the core formation is predicted. A
n axisymmetric and cyclic field similar to the present day Sun is excited i
n a star with a mature radiative zone. An infant Sun with its core just sta
rting to grow generates a nonaxisymmetric global field which is steady in a
rotating frame. A qualitative explanation for the nonaxisymmetry is sugges
ted. A model for the field capturing by the growing core is designed. The i
nternal field is most efficiently captured over the initial phase when the
core grows most rapidly. A nonaxisymmetric global relic field with an ampli
tude somewhat below 1 G is predicted for a main-sequence star of solar mass
. An interpretation of the active longitude phenomenon as observed on the S
un and stars in terms of the nonaxisymmetric relic field is suggested.