Aaron Hernandez’s older brother, Dennis “D.J.” Hernandez, was arrested last week after he allegedly threw a brick at ESPN’s headquarters with a note attached to it … TMZ Sports has learned.

According to police documents, the incident happened at around 3 PM on March 23 at the famed Bristol, Conn. campus — just after cops were asked to perform a welfare check on D.J. after he had allegedly stated he wanted to smash out windows at the State Capital and at ESPN.

Police say ESPN security told them an Uber had arrived at one of their gates — but when it was turned away, a passenger in the car got out of the ride, threw something onto the grounds, and then got back into the vehicle and left.

Cops in the documents say when they investigated the object, they discovered it was a white plastic bag with a large brick in it. They also say it had a handwritten note on it.

“To all media outlets,” cops say the message read. “It’s about time you all realeyes the affect media has on all family members. Since you’re a world wide leader maybe you could lead how media and messages are delivered brick by brick. Clean it up!”

Police say the note was signed, “Yours truly, Dennis J. Hernandez.”

Cops say when they spoke with a security guard who witnessed the incident at the booth — the worker told them they were “90 percent positive” the man who threw the object was D.J., a former Division 1 football player and Aaron’s older brother.

Cops say they ultimately made contact with D.J., and he admitted to being at ESPN, but “didn’t wish to speak about the incident.”

D.J. was arrested for misdemeanor breach of peace — but was released on a promise to appear in court next month.

Cops say they also advised D.J. he was no longer allowed at ESPN’s campus — and could be arrested for trespassing if he returned. They say D.J. “stated he understood.”

D.J. has not commented publicly on the incident.

The 36-year-old grew up with Aaron in Bristol … and decided to go by his middle name, Jonathan, after his brother’s murder case. He later wrote a book about Aaron, “The Truth About Aaron: My Journey to Understand My Brother,” following the former New England Patriots star’s death.