Israel's Supreme Court has ruled that the force-feeding of prisoners on hunger strike is constitutional after rejecting an appeal from the Israel Medical Association.

"This law is legal under Israeli law and international law," the court ruled on Sunday about a law passed in July last year allowing hunger-strikers to be force-fed if their lives are in danger.

"Saving a life must remain the priority and the state is responsible for the lives of its prisoners," the judges said, according to the Paris-based AFP news agency.

The medical association appealed against the law last year, calling it a form of torture.

READ MORE: Israeli doctors refuse to force-feed hunger-striking Palestinian prisoners

"The state is responsible for the safety of prisoners but also of its citizens, whose safety may be endangered because of events such as a hunger strike by prisoners," the judges added.

Shortly after the passing of the law in July 2015, United Nations officials condemned it, saying it was "a non-violent form of protest used by individuals who have exhausted other forms of protest to highlight the seriousness of their situations".

Many Palestinian prisoners held under Israel's controversial administrative detention law, which allows suspects to be held for renewable six-month periods without trial or charge, have staged hunger strikes.

Israel says the controversial practice allows authorities to hold suspects while continuing to gather evidence, while Palestinians, rights groups and members of the international community have condemned the system.

There are currently around 7,000 Palestinian prisoners held by Israel, of whom some 700 are under administrative detention.