He was doin’ time — with the Lord!

Mixed martial arts star Conor McGregor quietly completed his court-ordered community service, spending five days last week helping out at two Brooklyn churches.

McGregor was ordered to do “manual labor” that included “upkeep at the Brooklyn houses of worship, his lawyer, Bruce Maffeo told The Post.

“By all accounts, it was a full day’s work,” Maffeo said. “He wasn’t just sitting there throwing pencils at the ceiling.”

McGregor had to do time at the church thanks to his captured-on-video rampage at the Barclays Center in Brooklyn last April, when he threw a hand truck at a bus filled with other fighters.

According to Maffeo, the pastors at the churches appreciated “Conor’s positive attitude.”

The Brooklyn District Attorney’s office declined to say which local churches McGregor did his time.

Last July, McGregor scored a sweetheart plea deal when he copped to disorderly conduct charges and dodged jail time for the April 5 incident that left MMA fighters with injuries.

Fellow fighter Cian Cowley was sentenced to three days of community service and anger management in connection to the attack.

The last court appearance in McGregor’s case is later this month on March 29, but McGregor is not required to show up for it.

On Saturday, McGregor also completed a court-ordered, day-long anger management course.