The system of a chiral fermion field coupled to a background gauge field is considered. By taking what we call the particle picture and carefully defining the S-matrix in the Heisenberg picture, we investigate anomalous phenomena in this system. It is shown by explicit calculations that the gauge-field configuration with nonvanishing topological-charge causes anomalous production of particles that is directly responsible for the chiral U(1) anomaly. Unlike the chiral U(1) anomaly, the gauge anomaly, that is, gauge non-invariance of the S-matrix is a problem that arises in the phase of the S-matrix. It is shown that this phase is related to the freedom existing in the quantization method, and that a suitably chosen phase which of course is consistent with the equation of motion can remove the gauge anomaly. Finally, a modified form of path-integral quantization for this system is proposed.