A method and an arrangement for maximizing the yield of fatty acids, which are associated with the process of the refining of tall oil and, at the same time, producing from them fatty acid esters, particularly methyl esters, for use as fuel. According to the present invention, crude tall oil is first treated with formic acid, with which the alcohol groups are esterified. After the separation of the pitch and resin, the crude fatty acids are esterified in a primary oil column of a refinery, where the water generated and the excess alcohol derived from the process of the esterification are removed by distillation. Generally, the fatty acids, which end up in the primary oil and the bottoms products, are also mainly esterified, according to the present method, and thus it is possible to maximize the amount of the fuel esters (FAME).