HOUSTON – A man accused of shooting at officers during a SWAT standoff over the weekend was escorted out of a courtroom Monday during a profanity-laden tirade.

Keith Swainson is charged with two counts of aggravated assault of a public servant and one count of terroristic threat.

After complaints from his neighbors, officers arrived Saturday night to find Swainson, 49, locked inside his home on Kingsbridge Lane in west Houston.

During the seven-hour standoff, police said Swainson fired a shotgun several times at police. HPD Sgt. P. Weido fired back at Swainson. He was struck by debris from Swainson's gun and was treated at the scene.

After several unsuccessful attempts to communicate with Swainson, police said officers deployed tear gas into the residence.

[WATCH COURTROOM OUTBURST HERE]

Swainson eventually surrendered and was taken into custody.

"The case that he's been charged with is very serious, especially in light of what's going on in our community and our world today. But it is very serious; the threats that he made against officers," assistant district attorney Britni Cooper said.

During a court appearance Monday morning, Swainson, who appeared to have dried blood on one side of his face, could be heard directing comments toward the judge, then yelling loudly in the courtroom.

Another person in court yelled at Swainson, "Hey, you don't talk like that!"

Swainson began cursing out the person as law enforcement officials led Swainson out of the courtroom.

"We didn't to tell the complete story (to the judge) because the defendant did have an outburst in court today, but we did get through enough where the judge was able to find probable cause," Cooper said.

Swainson's defense attorney, David Parish II, who got the case Monday, said about his client's apparent injuries, "He has a right to see a medic or not see one, so it's up to him. They certainly have medical staff in the jail that can attend to his wounds and to his face. I imagine he will (see a medic). Everything that happened was in the last couple days so maybe he hasn't had time to see one."

Bond was set at $500,000. His next court appearance is scheduled for July 18.

Weido is assigned to the Westside Patrol Division and was sworn in as an officer in March 1990.

The case is being investigated by the HPD Homicide and Internal Affairs Divisions as well as the Harris County District Attorney's Office.