A D.C. federal appeals court has ruled that the chaplain for the House of Representatives cannot be forced to allow a self-described atheist to proclaim a secular prayer publicly to the body.

The decision, delivered on Good Friday, said the House rules allow for a religious invocation at the start of its work day, and a secular prayer does not qualify as a religious invocation.

The suit was raised by Dan Barker with the Freedom from Religion Foundation. He had asked to be a guest chaplain for the House of Representatives, but had been rejected by the House chaplain, Fr. Patrick Conroy.

Barker claimed that he had been rejected because he was an atheist, which he said amounted to an unconstitutional establishment of religion by Congress.

But the appeals court said the prayer was rejected because it was non-religious in nature, which renders it irrelevant that the proposed minister was an atheist.

"Even though we accept as true Barker's allegation that Conroy rejected him 'because he is an atheist,' the House's requirement that prayers must be religious nonetheless precludes Barker from doing the very thing he asks us to order Conroy to allow him to do: deliver a secular prayer," wrote Judge David Tatel on behalf of the three-judge panel.

He noted that Article 1, Section 5 of the Constitution allows the House to make its own rules. "Accordingly, we accept the House's interpretation of its own rules as requiring a religious prayer," he said.

Conroy, who has served as the House chaplain since May 2011, made headlines last year when he offered his resignation but then rescinded the resignation two weeks later.

He told then-Speaker of the House Paul Ryan (R-WI) that he would not leave voluntarily and that Ryan would have to fire him if he wished for him to leave his role.

Conroy said Ryan's chief of staff had asked him to resign, commenting on a prayer that he had offered several months earlier, which was perceived as critical of the Republicans' tax bill.

Ryan said that some House members had concerns about Conroy, and that he was not able to adequately tend to the spiritual needs of some Congressmen.

The Jesuit priest objected that he had never faced disciplinary measures or received any complaints about his ministry during his then-nearly seven years as House chaplain.

Ryan then said that he had decided to allow Conroy to "remain in his position as Chaplain of the House."