ATTLEBORO, Mass. -- Aaron Hernandez has been charged with murdering his friend after the two had a dispute during a trip to a nightclub.

Hernandez was arrested Wednesday and charged with the first-degree murder of 27-year-old Odin Lloyd, a semi-pro football player whose body was found in an industrial park about a mile from the former New England Patriots tight end's home.

Hernandez, released by the Patriots less than two hours after his arrest, pleaded not guilty and has been ordered to be held without bail. He also faces five gun-related charges, which were revealed Wednesday afternoon in Attleboro District Court.

Lloyd's relatives said he was dating the sister of Hernandez's fiancée, that the two men were friends and that the men were out together on the last night of Lloyd's life. Lloyd was shot multiple times in the back and chest, authorities said.

Hernandez, 23, also was charged with one count of carrying a firearm without a license, two counts of possessing a large-capacity firearm and two counts of possessing a firearm without an FID card. (An FID card is a firearms ID card and allows the holder to possess non-large-capacity rifles and shotguns in his or her home. It is not the same as a license to carry.)

Judge Daniel J. O'Shea ordered both prosecutors and Hernandez's defense attorneys to refrain from publicly commenting on the case.

"The reality is that this case is still an ongoing investigation," Bristol County District Attorney C. Samuel Sutter said. "Invariably it is in the best interest of an ongoing investigation for the district attorney's office not to comment."

Hernandez could get life without parole if convicted. He was transported to the Bristol County House of Correction and Jail in North Dartmouth, Mass.

"It is at bottom a circumstantial case. It is not a strong case," said Hernandez's attorney Michael Fee.

Hernandez will have a probable cause hearing July 24 at 9 a.m. ET.

Lloyd's family members cried and hugged in the courtroom as prosecutor Bill McCauley outlined the killing. Two relatives were so overcome with emotion that they had to leave the courtroom.

McCauley said the crime stemmed from a night out at a Boston club called Rumor on June 14. He said Hernandez was upset about certain things, including that Lloyd had talked to some people Hernandez "had troubles with."

Two days later, McCauley said, on the night of June 16, Hernandez texted two friends from out of state and asked them to hurry back to Massachusetts.

Surveillance footage from outside Hernandez's home showed him leaving with a gun, and he told someone in the house that he was upset and couldn't trust anyone anymore, the prosecutor said.

The three men picked up Lloyd at his home around 2:30 a.m., according to authorities. As they drove around, they discussed what happened at the nightclub, and Lloyd started getting nervous, McCauley said.

Lloyd texted his sister, "Did you see who I am with?" When she asked who, Lloyd answered, at 3:22 a.m., "NFL," then, a minute later, "Just so you know."