Aaron Hernandez -- ATTACKS INMATE at Bristol County Jail

Sources tell us the former New England Patriots tight end -- who is usually segregated from the general population -- was allowed to take a walk in an isolated hallway ... but somehow came into contact with another inmate.

We're told Hernandez recognized the other inmate and launched into an attack -- beating the other man up pretty badly.

Sources tell us ... Hernandez and the other man had been beefing all day long. One source says the other guy had been harassing Aaron nonstop. Clearly, Hernandez was pissed.

The 24-year-old has been locked up since June 26th -- he's facing murder charges stemming from the 2013 shooting death of semi-pro football player Odin Lloyd.

Officials had placed Hernandez in solitary confinementout of concern he would be a target behind bars due to his celebrity status.