A man who ran unsuccessfully for a seat on the Prince George’s County Council in 2010 pleaded guilty Wednesday to using campaign money on personal expenses such as gas, groceries and auto repairs, authorities said.

Darrell Miller, 47, the former mayor of Capitol Heights, was fined $2,000 and sentenced to 300 hours of community service as part of the plea agreement, in which he admitted violating election law during his 2010 council run, according to a news release from the Office of the Maryland State Prosecutor. He was also sentenced to two years of supervised probation, according to the release.

According to the state prosecutor’s office, Miller violated two facets of election law during his campaign between July 1, 2010, and November 15, 2010. First, Miller served as chairman of his own election committee and paid out money from the committee’s account, “Friends of Darrell A. Miller.” An election committee chairman who is also running for office is expressly prohibited from disbursing money, as that function is usually reserved for the committee’s treasurer, said Deputy State Prosecutor Mike McDonough.

Second, Miller used campaign money to cover several small, personal expenses unrelated to his election bid — such as hotel meals, car repairs, gas and groceries, McDonough said. He said in total, Miller spent $1,054 of campaign money on personal expenses.

William C. Brennan, Miller’s defense attorney, did not immediately return a phone message seeking comment. Miller was convicted and sentenced in Anne Arundel County Circuit Court.