ATLANTA — An attorney for a former Atlanta fire chief argued in court Friday that his client was let go for his religious beliefs, but lawyers for the city disputed that.

Kelvin Cochran wrote a book called “Who Told You That You Were Naked?” for a men’s Bible study and self-published it in late 2013. He gave copies to about a dozen subordinates who he said had requested copies or who he knew shared his religious beliefs.

He was fired in January 2015 and filed a federal lawsuit against the city and Mayor Kasim Reed, saying his free speech and due-process rights had been violated. U.S. District Judge Leigh May on Friday heard arguments in the case.

The book lumps together gay people, those who have sex outside of marriage and non-Christians with murderers, rapists, pedophiles and those who engage in bestiality, city lawyer David Gevertz said Friday. The book calls such people wicked and ungodly, he said.

But Cochran attorney Kevin Theriot told reporters after the hearing that the book is meant to help Christian men be better husbands and fathers.

“There are a few isolated passages that they take out of context to try to depict the chief as being somebody who’s hateful when, in fact, Chief Cochran’s beliefs require him to treat everybody equally and the only evidence before the court is that’s what he always did,” Theriot said.

Cochran said he was shocked that a book encouraging men to be better could jeopardize his 34-year career.

“It’s still unthinkable to me that the very faith and patriotism that inspired my professional achievements and drove me to treat all people with love, equity and justice actually is what the government used to … end my childhood dream-come-true career,” Cochran told reporters.

An assistant chief who had been given a copy of the book raised concerns in October 2014 about some of the book’s statements on homosexuality, especially since Cochran clearly identified himself in the book as Atlanta’s fire chief.

The following month, Reed suspended Cochran for 30 days without pay to discipline him for selling his book without providing proper notice or getting written approval, Gevertz said. The city law department also opened an investigation into whether Cochran had improperly imposed his views in the workplace. Cochran was told not to make public comments on his suspension, Gevertz said.

But Cochran spoke out, saying publicly that he’d been fired for his religious beliefs, and helped organize a public relations campaign to challenge his suspension, Gevertz said. The mayor got more than 17,000 angry emails, some of them using racial slurs, Gevertz said.

Reed fired Cochran because he violated the terms of his suspension by publicly saying he was fired for his religious beliefs, which irreparably damaged his relationship with the mayor, and because the law department found that while Cochran hadn’t engaged in illegal discrimination, his subordinates lacked faith in his leadership abilities due to the publication and distribution of the book, city lawyers said.

Gevertz also mentioned that the book could cause problems for the city because fire department employees who were fired or denied a promotion could assert that Cochran’s beliefs were the reason.

Theriot told the judge that comments the mayor made when Cochran was suspended and when he was fired make it clear that Reed was retaliating against Cochran because of what the mayor saw as inflammatory ideas presented in the book. Requiring him to have prior approval before publishing his ideas and punishing him for stating his viewpoint are violations of his right to free speech, Theriot said.

The judge, who questioned both sides extensively during the hearing, said she plans to rule in the coming weeks. She could decide to rule on the issues of law raised by the two sides, effectively ending the case, or she could decide there are factual matters that need to be decided by a jury at trial.