MONTGOMERY, Ala. (AP) — Alabama Senate candidate Roy Moore had a deal to collect $180,000 in annual salary for part-time work from the legal charity he founded and ended up with a half-million-dollar stake in the group's headquarters, records and interviews show.

Property, charity and tax records reviewed by The Associated Press show that the former chief justice received direct payment of $448,000 over the six years he served as president of the Foundation for Moral Law and was given a $540,000 mortgage on the charity's building when the group said it couldn't afford to pay his salary.

Moore is the leading candidate to replace Attorney General Jeff Sessions in the U.S. Senate and his pay from the religious-themed charity has become an issue in the race.

In an interview with The Associated Press last month, Moore defended his compensation from the group and said it has never paid him the $540,000 owed to him.

The firebrand jurist founded the Foundation for Moral Law in 2003 after a judicial discipline panel removed him as Alabama chief justice for disobeying a federal court order to take down a Ten Commandments monument from the state judicial building. The nonprofit specializes in religious freedom issues.

John Bentley, a circuit judge who serves as chairman of the foundation, told The Associated Press on Wednesday that the charity's board agreed in 2007 to pay Moore a salary of $180,000, which was on par with what he was making as chief justice and that Bentley said was comparable to directors at other legal nonprofits.

"We felt like at the time was a fair salary for the responsibility he had. ... But he was not paid that. We didn't have the money," Bentley said.

Moore told the AP that, to avoid being a drain on the group's finances, he would only accept money from Project Jeremiah, which he said was money raised by his speaking engagements.

Bentley and Moore said that, even with Project Jeremiah, the foundation did not have the money to pay Moore the $180,000 salary, so he was given a promissory note and second mortgage on the group's headquarters, a historic building in Montgomery. Bentley said it was his idea to offer Moore the interest on the building.

Property records show that the Foundation for Moral Law gave Moore a promissory note and mortgage on its building for $393,000 in February 2011. The foundation's notation said that it was given in lieu of a salary promised to Moore but that the charity had not been able to pay over the previous three years. On Dec. 19, 2011, the group's debt to Moore was raised to $498,000. It was raised again on Dec. 28, 2012, to $540,000.

"He didn't receive anything. A piece of paper. It's worthless unless the first mortgage is paid," Bentley said, noting that the foundation still owes the bank money. Paperwork filed in Montgomery County Probate Court shows that Moore agreed that the foundation's debt to a bank would take priority over money owed to him.

The first promissory note was listed on the Foundation's 2011 tax return as $393,000 in "retirement and other deferred compensation" to Moore. It included a notation that Moore was paid upon the availability of funds and that the unpaid salary would accrue until funds were available. The tax returns did not reference an agreement to pay him $180,000 annually.

Tax filings by the foundation show that Moore's highest yearly payment was $138,000, in 2012. The filing said he worked about 20 hours per week in his role as president.

Moore defeated incumbent Sen. Luther Strange, an appointee who had been backed by President Donald Trump, in the GOP primary for the Senate seat and faces Democrat Doug Jones in a December special election.

A group supporting Strange ran ads claiming Moore collected $1 million from the group, a figure which includes the $393,000 building interest. Moore's campaign called the ad misleading.

Jones on Wednesday issued a statement criticizing the payments to Moore.

"Once again, we see that Roy Moore has put his own interests ahead of the people of Alabama. This time, Moore misled the public and charitable donors by arranging a secret deal where he pocketed more than $1 million from his charity for part-time work," Jones said.