Assemblyman Tim Donnelly, a tea party member and gun rights advocate, was detained at Ontario International Airport after a loaded gun was found in his briefcase. He says he forgot the gun was there.

Reporting from Sacramento -- A California lawmaker who has been a vocal advocate for gun rights was detained by police Wednesday at Ontario International Airport after attempting to take a loaded gun onto an airplane.

Tim Donnelly, a Republican from San Bernardino and the Assembly's lone tea party member, was headed for a Sacramento-bound flight to attend the opening of the new legislative year. Authorities said screeners at the security checkpoint discovered a loaded .45-caliber Colt Mark IV pistol and an ammunition magazine with an additional five rounds in his carry-on luggage.

He was detained, mistakenly cited for carrying an unloaded firearm (police said the citation would be corrected) and released. The offense is a misdemeanor punishable by up to one year in county jail and a maximum fine of $1,000. The gun and magazine were seized by police.

Speaking to reporters outside the Assembly chambers, the freshman lawmaker called the incident an "unfortunate mistake," saying he had forgotten to remove the gun from his briefcase after placing it there while working in his garage over the weekend.

"I completely forgot, coming back to work this morning, that it was in my briefcase," Donnelly said. "It was about as heavy as it is when you carry a laptop. So it just didn't register."

Donnelly would not say whether he has a concealed weapons permit. The San Bernardino County sheriff's office does not have one on file for him, said spokeswoman Jodi Miller.

Donnelly said he regularly carries a firearm because he has received death threats since proposing to roll back state financial aid for illegal immigrants. The offices of the Assembly speaker and that of the sergeant at arms, which provides security for members, said the lawmaker had reported no such threats to them.

Donnelly, a former member of the volunteer border-patrol group known as the Minutemen, was elected to the Assembly in 2010 on an anti-illegal-immigration platform. He has invited controversy, offending some lawmakers last year by mounting antique rifles on his Capitol office wall. He is also known for his bombastic rhetoric, on and off the Assembly floor.

Last year, Donnelly opposed a bill that became law Jan. 1, banning the open carrying of handguns; he called it "a form of tyranny." He tried — and failed — to import Arizona's controversial immigration law to California. And he is leading a push to repeal the state's DREAM Act, which gives illegal immigrants access to private financial aid at public universities and community colleges beginning this year and access to publicly funded aid in 2013.

Analysts said the incident could complicate what is expected to be a tough reelection battle for Donnelly, a political novice who benefited from a bruising six-way primary two years ago.

"It's certainly not going to help him," said Allan Hoffenblum, a former GOP strategist who publishes the California Target Book, which tracks legislative races. "How much damage it does, we'll just have to wait and see."

The firearm dustup elicited chortles from Democrats as lawmakers returned to the Capitol after a months-long recess. Gil Duran, Gov. Jerry Brown's press secretary, posted a link on Twitter to the California Department of Justice's "Six Basic Gun Safety Rules."

"This is a teachable moment, people," he wrote. "Always — ALWAYS! — remember exactly where you left your half-loaded gat."