The shooting occurred just before the courthouse opened at 09:00 (14:00 GMT) in Canton, a town about 45kmnorth of Jackson, the state capital, local television WAPT reported.
The district attorney said the victim, Kendrick Brown, was on his way to court to face drug charges.
One witness quoted by the station said a man sitting on a bench got up and shot Brown as he approached the courthouse. Another said the shooter pulled up in a pickup, got out and shot Brown.
A suspect was taken into custody, the witnesses said.