  We perform high-resolution cosmological hydrodynamic simulations to study the
formation of the first galaxies that reach the masses of
$10^{8-9}~h^{-1}~M_\odot$ at $z=9$. The resolution of the simulations is high
enough to resolve minihaloes and allow us to successfully pursue the formation
of multiple Population (Pop) III stars, their supernova (SN) explosions,
resultant metal-enrichment of the inter-galactic medium (IGM) in the course of
the build-up of the system. Metals are ejected into the IGM by multiple Pop III
SNe, but some of the metal-enriched gas falls back onto the halo after $\gtrsim
100~\rm Myr$. The star formation history of the first galaxy depends
sensitively on the initial mass function (IMF) of Pop III stars. The dominant
stellar population transits from Pop III to Pop II at $z\sim 12-15$ in the case
of power-law Pop III IMF, ${\rm d}n/{\rm d}M \propto M^{-2.35}$ with the mass
range $10-500~M_\odot$. At $z\lesssim 12$, stars are stably formed in the first
galaxies with a star formation rate of $\sim 10^{-3}$-$10^{-1}~M_\odot/{\rm
yr}$. In contrast, for the case with a flat IMF, gas-deprived first galaxies
form due to frequent Pop III pair-instability SNe, resulting in the suppression
of subsequent Pop II star formation. In addition, we calculate UV continuum,
Ly$\alpha$- and H$\alpha$-line fluxes from the first galaxies. We show that the
James Webb Space Telescope will be able to detect both UV continuum, Ly$\alpha$
and H$\alpha$ line emission from first galaxies with halo mass $\gtrsim
10^{9}~M_\odot$ at $z \gtrsim 10$.
