Faced with the depletion of fossil fuels and increasingly serious environmental pollution, finding an environmentally friendly renewable alternative fuel has become one of the current research focuses. In order to find new alternative fuels, reduce dependence on fossil fuels, improve air quality, and promote sustainable development goals, castor biodiesel was produced through transesterification, and mixed with diesel in a certain proportion. The engine performance and emissions were compared and analyzed under fixed load and different speeds of agricultural diesel engines. Biofuel, as a fuel containing oxygen, promotes complete combustion to a certain extent. As the proportion of castor biodiesel in the mixed fuel increases, the emissions of pollutants such as CO, HC, and smoke show a decreasing trend. The lowest CO, HC, and smoke emissions were observed in the B80 blend at 1800 rpm, at 0.3%, 23 ppm, and 3%, respectively. On the contrary, the CO2 and NOx emissions of the B80 blend are higher than those of 2.7 diesel, reaching 2.5% and 332 ppm respectively at 1800 rpm. The lower calorific value and higher viscosity of biodiesel result in a decrease in BTE and an increase in the BSFC of the blends. Higher combustion temperatures at high speeds promote oxidation reactions, resulting in reduced HC, CO, and smoke emissions, but increased CO2 and NOx emissions. At high speeds, fuel consumption increases, BSFC increases, and BTE decreases. Overall, castor biodiesel has similar physical and chemical properties to diesel and can be mixed with diesel in a certain proportion for use in CI engines, making it an excellent alternative fuel.