Former Brooklyn District Attorney Charles “Joe” Hynes has agreed to pay a $40,000 fine for improper use of his official email account during his failed 2013 run for a seventh term in office.

Hynes’ payment of the fine is part of a settlement agreement reached with the New York City Conflicts of Interest Board, which announced on Tuesday that Hynes used his official email account with the Brooklyn District Attorney’s Office to send more than 5,000 campaign-related emails during his primary battle against Kenneth Thompson.