James T. Hodgkinson had a violent history involving guns long before he opened fire on the congressional baseball practice.

According to police records ... Hodgkinson was busted in 2006 for allegedly punching his daughter's 20-year-old female friend and striking a male friend with the butt of a shotgun. Police say he also fired a shot that didn't hit anyone.

Hodgkinson was trying to get his daughter to leave the friend's house ... but when she refused, he got physical. Police say he grabbed his daughter by her hair, and pulled her to the floor.

The daughter broke free and tried to flee in a car, but he reached in and cut her seat belt with a pocketknife. That's when he punched the female friend in the face with a closed fist.

According to the docs ... the male friend then confronted Hodgkinson, who pulled out a shotgun and pointed it at the guy, and then struck him with the wooden stock of the gun.

He was arrested for aggravated discharge of a firearm and domestic battery, but the charges were later dismissed.