Carbon nanofibers (CNFs) were prepared by electrospinning, and silver (Ag) ions were grown on the surface of the CNFs by in situ solution synthesis. The structure and morphology of obtained Ag-doped CNFs (Ag-CNFs) were characterized by X-ray diffraction (XRD) and scanning electron microscopy (SEM). The gas sensibility of the composite fiber was investigated by ammonia (NH3) obtained by natural volatilization from 1 to 4 mL of NH3 solution at room temperature. It was found that the fibers exhibited a sensitive current corresponding to different NH3 concentrations and a greater response at high concentrations. The sensing mechanism was discussed, and the good absorptivity was demonstrated. The results show that Ag-CNF is a promising material for the detection of toxic NH3.