Prime Minister Tony Abbott said the government might be forced to direct money through the states to ensure its school chaplaincy program can continue.

Money for the controversial school chaplaincy program could be directed through the states, as the federal government tries to overcome a High Court ruling against it.

Five High Court justices on Thursday unanimously upheld a legal challenge against the funding arrangements for the program.

Prime Minister Tony Abbott says the government is considering a range of options to ensure the program can continue.

“If we have to go through the states, no doubt that’s what we’ll end up doing,” he told Macquarie Radio on Friday.

But it was important that states passed the full amount of federal funds to schools, he said.

“The difficulty with using the states as a middle-man is that sometimes the states cream off some of the money, sometimes the states want to impose their own conditions on things,” Mr Abbott said.

The challenge was the second brought to the program by Queensland father Ron Williams, who believes there is no place in secular public schools for religious programs.

The court in 2012 upheld his initial challenge but the previous Labor government passed laws to keep the program going.

However, the court found on Thursday the government had no executive power to fund the agreement with Scripture Union Queensland.

The government has set aside $245 million for the program over the next four years.