Then Adonai spoke to Moses saying,
However, 24,000 were dead because of the plague!
“Phinehas son of Eleazar son of Aaron the kohen has turned away My anger from Bnei-Yisrael because he was very zealous for Me among them, so that I did not put an end to Bnei-Yisrael in My zeal.
It was credited to him as righteousness, from generation to generation forever.