ISLAMABAD (AP) — Thousands of hard-line Islamists angered over a far-right Dutch lawmaker's plans to hold a Prophet Muhammad cartoon contest marched toward Pakistan's capital Thursday after police briefly stopped them because of security reasons.

Later on Thursday, the Dutch lawmaker, Geert Wilders, said he was canceling the contest, saying the anger it generated could put more people than just him at risk.

"To avoid the risk of victims of Islamic violence, I have decided not to let the cartoon contest go ahead," Wilders said in a written statement.

Some 10,000 supporters of the Tehreek-i-Labaik group, which helped Imran Khan to become prime minister following last month's national elections, set out on their protest march Wednesday, calling on Khan to cut diplomatic ties with the Netherlands.

The demonstrators were expected to camp out near Islamabad later Thursday.

Physical depictions of the prophet are forbidden in Islam and deeply offensive to Muslims. Pakistan's government had vowed to protest the contest at the U.N.

Authorities blocked the capital's key roads by putting out shipping containers to prevent demonstrators from reaching near the area where the Dutch and other foreign embassies are located.

Earlier, police halted the march in Jhelum, about 100 miles (160 kilometers) from Islamabad but later it was allowed to resume, party spokesman Eijaz Ashrafi told The Associated Press.

He said they refused to disperse, saying the police will have to "kill us" to stop the march.

Ashrafi said they told Khan's government that it had two options: Cut diplomatic ties with the Netherlands or kill them and "send our dead bodies to Lahore."

"So far, better sense has prevailed," he said. "We are 50 miles away from Islamabad."

The party's firebrand chief Khadim Hussain Rizvi in Jhelum also warned Khan to remove any hurdles.

"We are on roads to show to the world that we can die to protect the honor of our Prophet," he told demonstrators.

The rally came as emotions ran high in Pakistan against the cartoon contest.

Wilders has a history of inflammatory statements about Islam. The Dutch government distanced itself from the contest but had said it was committed to upholding the right to free speech.

Pakistan's Foreign Ministry spokesman Mohammad Faisal said Thursday that Islamabad conveyed its deep concern to Netherlands over the planned cartoon contest. He said the contest was a "deliberate and malicious attempt to defame Islam."

However, Faisal said Pakistan would avoid any unnecessary extreme action against Netherlands over the contest.

Also on Thursday, a Dutch judge extended by two weeks the detention of a 26-year-old man who allegedly threatened to attack Wilders.

___

Associated Press writer Mike Corder in The Hague, Netherlands contributed to this report.