Huckabee, formerly a challenger for this year's Republican presidential nomination, was speaking at the National Rifle Organization convention in Louisville, Ky., when he made the joke about the Democratic presidential hopeful. As Huckabee was delivering his remarks, there was a thumping sound offstage.
"That was Barack Obama, he just tripped off a chair, he's getting ready to speak," Huckabee joked. "Somebody aimed a gun at him and he dove for the floor."
Huckabee late Friday issued a statement apologizing for the remark, The New York Times reported.
"I made an off hand remark that was in no way intended to offend or disparage Sen. Obama," the statement said. "I apologize that my comments were offensive. That was never my intention."
Obama, the junior senator from Illinois, has called for extending the national assault weapons ban, limits on gun sales, and a national law against carrying concealed weapons, with few exceptions.
Speaking with reporters Friday in South Dakota, Obama said he sees gun ownership as an individual constitutional right but said there should be "common sense" laws on background checks and other processes meant to promote gun safety.