The reduction of dinitrogen (N2) to ammonia (NH3) by the enzyme nitrogenase. Biological nitrogen fixation is carried out by some bacteria.