TMZ reports that David was taken into custody earlier, after being caught carrying a loaded gun through Los Angeles International Airport.
Police sources tell the site that he was trying to get through a security checkpoint at LAX when TSA agents discovered a loaded M&P Shield 9mm pistol in his possession.
He was detained straight away and still remains in police custody.
Just last week David and Maria announced that they were expecting their first child, a baby girl.
"ITS A GIRL ITS A GIRL ITS A GIRL. Im a Poppa!!!!!!! Im so overwhelmed with joy I had to share this with you guys. I’m already singing ‘I Loved Her First’. That reminds me. Where’s my shotgun? I don’t have a shotgun. Someone get me a shotgun! I can’t wait to sit her down on a couch and tell her a 9 season story of How I Met Your Mother #baby #itsagirl #shotgun #poppa #dad."
Crazily, he has removed the entire shotgun part of the caption after being arrested.
He has also issued an apology via Twitter.
"I take responsibility for the situation at LAX today. I unintentionally brought my legally owned gun which is registered in my name to the airport," he said in a statement.
"I am so sorry for any trouble it caused, but I am appreciative of TSA’s efforts in implementing the safety laws that are in place to protect our beautiful country.
"More than anything I am humiliated and embarrassed that this even happened. But I am thankful to the TSA, LAPD and all involved today for their kindness and their professionalism during this process," he added.
Henrie was released at 3:02 p.m. on a $10,000 bail, as PEOPLE reports. He will appear in court on Oct. 1.