Nicki Minaj (from the left), Madonna and M.I.A. were doing so well and then M.I.A. misbehaved. (MIKE SEGAR / Reuters)

NBC and the NFL have apologized for an obscene gesture and expletive by M.I.A. near the end of the Super Bowl XLVI halftime show starring Madonna.

“We apologize for the inappropriate gesture that aired during halftime,” NBC spokesman Christopher McCloskey said. “It was a spontaneous gesture that our delay system caught late.”

Madonna had promised that there would be no wardrobe malfunction, a la Janet Jackson’s nipple slip of eight years ago, but the problem in this halftime show was not of her making. M.I.A. extended her middle digit and appeared to sing “I don’t give a s---” during a performance of Madonna’s new single, “Give Me All Your Luvin.’ ” The screen was blurred, but the effort was too little, too late. (Deadspin has the screengrab.)

The NFL, which produces the show, said the delay system failed and that there was no whiff of controversy during rehearsals.

“The obscene gesture in the performance was completely inappropriate, very disappointing, and we apologize to our fans,” NFL spokesman Brian McCarthy said.

How bad was M.I.A.’s transgression? It was about as fleeting as Jackson’s slip — both of which got less air time than Prince’s suggestively shaped guitar in 2007.

Celebritology: A halftime controversy

Early Lead: Madonna promised...