Texas state police said a man with a handgun fired several shots on the south steps of the state Capitol on Thursday afternoon.
The Texas Department of Public Safety said Fausto Cardenas, 24, is being charged with deadly conduct.
More than half a dozen DPS cars descended on the Capitol Thursday afternoon after several shots were fired just after noon, and officers toting rifles surrounded the building in Austin.
The latest news from around North Texas.
There were no reports of injuries, DPS said.
Gov. Rick Perry was not in the building at the time, his office said, and many lawmakers were away from Austin on Thursday because the legislature was not in session.
Some lawmakers were inside the Capitol, though. House Speaker Joe Straus' office said he was stuck in the building while it was on lockdown. Sen. Leticia Van De Putte wrote on her Twitter page that she was also inside.
Republican Sen. Dan Patrick wrote on his Twitter page that he wasn't in the office but his staff called security.
"An individual came into my Austin Senate office today acting strangely, staff called security, moments later shots fired on Capitol steps," he wrote.
Lorne Kozak, of Edmonton, Alberta in Canada, was visiting the Capitol grounds with his 10-year-old son Spencer when they heard gunfire. He said they were about 30 yards from the steps when the shots rang out.
"What I heard was four rifle shots," Kozak said. "There appeared to be a cluster of officers attending to someone on the steps and more officers kept pouring out of the building and of course the sirens."
They snapped a few quick pictures before walking away when police told them to leave.
Perry issued a statement Thursday afternoon commending the DPS troopers who responded.
"Thanks to their efforts, no one was injured, and the shooter was apprehended immediately and taken into custody," he said.
Cardenas is being held at the Travis County Jail.