Give (someone) credit for (something)

To acknowledge or thank someone for something that they have done.

Everybody gave the man credit for saving the life of the girl.