The objective of this paper was to report the effect of ionic liquids (ILs) in the elaboration of nanofibers of cellulose bagasse from Agave tequilana Weber var. azul by the electrospinning method. The ILs used were 1-butyl-3-methylimidazolium chloride (BMIMCl), and DMSO was added as co-solvent. To observe the effect of ILs, this solvent was compared with the organic solvent TriFluorAcetic acid (TFA). The nanofibers were characterized by transmission electron microscopy (TEM), X-ray, Fourier transform-infrared using attenuated total reflection (FTIR-ATR) spectroscopy, and thermogravimetric analysis (TGA). TEM showed different diameters (ranging from 35 to 76 nm) of cellulose nanofibers with ILs (CN ILs). According to X-ray diffraction, a notable decrease of the crystalline structure of cellulose treated with ILs was observed, while FTIR-ATR showed two bands that exhibit the physical interaction between cellulose nanofibers and ILs. TGA revealed that CN ILs exhibit enhanced thermal properties due to low or null cellulose crystallinity. CN ILs showed better characteristics in all analyses than nanofibers elaborated with TFA organic solvent. Therefore, CN ILs provide new alternatives for cellulose bagasse. Due to their small particle size, CN ILs could have several applications, including in food, pharmaceutical, textile, and material areas, among others.