By using the first-principle methods, we have investigated the adsorption of the CO, CO2, NO, and NH3 molecules on an armchair graphene nanoribbon (AGNR). The optimal adsorption
positions and orientations of these molecules on AGNR are determined. The adsorption energies, the charge transfer, and the density of states (DOS) are obtained. The NO, CO, and CO2 adsorbed molecules act as an acceptor, and the NH3 adsorbed molecule acts as a donor. The NO and CO molecules contributed with localized states in the center of the original band gap. But the system exhibits -type or -type semiconductor after NH3 or CO2 adsorption.