MANILA — The Philippine Supreme Court upheld on Tuesday President Rodrigo Duterte’s declaration of martial law in the southern Philippines, which he says is needed to crush an uprising by militants linked to the Islamic State.

The court dismissed challenges to the order Mr. Duterte issued on May 23, days after militants launched attacks aimed at taking over the southern city of Marawi, where fighting still continues. The edict gives the military widespread powers not just in Marawi but across the large southern island of Mindanao, including carrying out warrantless arrests and setting up roadblocks and checkpoints.

Mr. Duterte had said Saturday that he would ignore the court if it struck down the order. Eleven of the 14 justices voted to uphold it, Ted Te, a spokesman for the court, said Tuesday. One said it was unconstitutional, and the three others said it should be limited to Marawi, Mr. Te said.

The government’s chief lawyer, Jose Calida, said the ruling “underscores the existence of real and present rebellion that threatens the lives of our fellow Filipinos in Mindanao, and their much-cherished liberties.”