In a statement on social media, the 29-year-old said he had brought the weapon to security "unintentionally".
He said he felt "humiliated and embarrassed" and thanked Los Angeles police and airport security.
Henrie found fame on the television series the Wizards of Waverly Place alongside singer Selena Gomez.
The Emmy-winning teen fantasy series had more than 100 episodes, running on Disney from 2007 to 2012.
The actor is also known for a number of films and appearances on hit US sitcoms How I Met Your Mother and Arrested Development.
His weapon, reported to be a 9mm pistol, was loaded when it was found in Terminal 2 of LAX airport at just after 09:05 local (16:05 GMT) on Monday.
Celebrity news website TMZ shared a photograph that appeared to show Henrie detained with his hands behind his back by airport security officials.
He was then transferred to a local police station to be booked.
In later posts on social media, Henrie took responsibility for the incident and apologised for "any trouble caused".
He also thanked officials for their "kindness and professionalism" and the work they do to protect the US.
An official account associated with the airport's police replied to the actor on Twitter and said it was "unfortunate you had to meet our officers in these circumstances" before wishing him "safe travels".
People magazine reports Henrie was released on Monday afternoon after paying $10,000 (£7,700) bail.
US media say the actor will appear in court on 1 October over the incident.
The actor announced earlier this week he is expecting a daughter with his wife.
More about: Disney