“NBC Nightly News” anchor Brian Williams last night had to make the humiliating admission that he was not aboard a helicopter hit by RPG fire during the invasion of Iraq in 2003, a false claim that he made and was repeated by the network for years.

Williams — who’d claimed he was in a chopper forced down by a rocket-propelled grenade 12 years ago — repeated the story on Friday’s newscast during a tribute for a retired sergeant major.

“The story actually started with a terrible moment a dozen years back during the invasion of Iraq, when the helicopter we were traveling in was forced down after being hit by an RPG,” Williams said on Friday’s show. “Our traveling NBC News team was rescued, surrounded and kept alive by an armor-mechanized platoon from the US Army 3rd Infantry.”

He was busted when vet Lance Reynolds commented on the “Nightly News” Facebook page, where the clip was posted, “Sorry, dude, I don’t remember you being on my aircraft. I do remember you walking up about an hour after we had landed to ask me what had happened.”

Amid a vicious ratings battle with ABC’s “World News Tonight,” which has positioned anchor David Muir as an equally strong on-the-scene reporter, Williams, who has a $10 million-a-year deal with NBC, made an embarrassing apology.

He claimed on Facebook that he had confused events: “I spent much of the weekend thinking I’d gone crazy. I feel terrible about making this mistake.” Stars and Stripes, which broke the story, reported that a different Chinook was hit by rockets and “the NBC anchor was nowhere near that aircraft . . . Williams arrived in the area about an hour later on another helicopter.”

Stars and Stripes quotes people from the scene who recall NBC reporting that Williams was aboard the attacked chopper. Mike O’Keeffe, who was a gunner on the damaged Chinook, said, “I can’t believe he is still telling this false narrative.” Williams admitted on-air Wednesday, “I want to apologize . . . This was a bungled attempt by me to thank one special veteran.”

Brian Williams’ full statement: