Starting from a prestellar core with a size of 1.2 \times 10 ^ { 4 } AU , we calculate the evolution of a gravitationally collapsing core until \sim 2000 yr after protostar formation using a three-dimensional resistive magnetohydrodynamic simulation , in which the protostar is resolved with a spatial resolution of 5.6 \times 10 ^ { -3 } AU . Following protostar formation , a rotationally supported disk is formed . Although the disk size is as small as \sim 2 - 4 AU , it remains present until the end of the simulation . Since the magnetic field dissipates and the angular momentum is then not effectively transferred by magnetic effects , the disk surface density gradually increases and spiral arms develop due to gravitational instability . The disk angular momentum is then transferred mainly by gravitational torques , which induce an episodic mass accretion onto the central protostar . The episodic accretion causes a highly time-variable mass ejection ( the high-velocity jet ) near the disk inner edge , where the magnetic field is well coupled with the neutral gas . As the mass of the central protostar increases , the jet velocity gradually increases and exceeds \sim 100 { km s } ^ { -1 } . The jet opening angle widens with time at its base , while the jet keeps a very good collimation on the large scale . In addition , a low-velocity outflow is driven from the disk outer edge . A cavity-like structure , a bow shock and several knots , all of which are usually observed in star-forming regions , are produced in the outflowing region .