David Simon, the creator of The Wire and Treme, told the The Washington Post that Mills collapsed on the set of Treme and died of an apparent brain aneurysm. The two men worked together for years, first at the University of Maryland student newspaper, The Diamondback.
HBO did not comment on the cause of death.
"HBO is deeply saddened by the sudden loss of our dear friend and colleague David Mills," the network said in a statement. "He was a gracious and humble man, and will be sorely missed by those who knew and loved him, as well as those who were aware of his immense talent. David has left us too soon, but his brilliant work will live on."
Mills made his television writing debut with NBC's Homicide: Life on the Street, based on Simon's book. Before working in television, Mills was a reporter for the Post, while Simon worked for the Baltimore Sun. Among Mills' stories was one on rapper Sistah Souljah in which she made statements that became an issue in the 1992 presidential campaign.
Mills, who won Emmys for his work on the miniseries The Corner, also wrote for NYPD Blue, ER, and The Wire. He also authored the brilliant pop-culture blog Undercover Black Man, where he wrote about Treme on Monday.
The show is scheduled to air April 11.