President Obama is holding on to Eric Holder as the nation’s top law-enforcement official, The Post has learned.

The newly re-elected president asked his controversial attorney general to stay for the second term, and Holder has agreed despite enduring a firestorm of criticism from Republican lawmakers.

“I don’t know if everyone in the White House wants him [Holder] to stay, but the important guy does, and that’s all that matters,” said one person briefed on the matter.

Holder’s office declined to comment.

His hardest-fought battle came over the botched sting operation called Fast and Furious, which allowed Mexican drug gangs to get their hands on American guns.

Holder, 61, was accused of stonewalling a House investigation into the case and was held in contempt of Congress this year.