MANILA — The International Criminal Court is opening a preliminary investigation into accusations that President Rodrigo Duterte and other Philippine officials committed crimes against humanity in the course of the government’s deadly crackdown on drugs, the presidential spokesman said Thursday.

The spokesman, Harry Roque, said the inquiry would determine whether there was enough evidence to build a case against Mr. Duterte. But he said that the government’s crackdown, which has left thousands dead since Mr. Duterte took office in June 2016, a “legitimate police operation,” and that the president welcomed The Hague-based tribunal’s decision.

“He is sick and tired of being accused of the commission of crimes against humanity,” Mr. Roque told reporters in Manila.

The tribunal did not immediately confirm that a preliminary investigation was underway.

In a 77-page complaint filed to the tribunal in April, a Filipino lawyer accused Mr. Duterte and 11 other officials of mass murder and crimes against humanity. He called Mr. Duterte the “mastermind” of a campaign of extrajudicial killings that dated back to the late 1980s, when he became mayor of the southern city of Davao, and that greatly escalated after he became president.

The lawyer, Jude Josue Sabio, represented two men who said they had been assassins for Mr. Duterte in Davao.

“I am elated and vindicated,” Mr. Sabio said. He said he was “confident we will hurdle this first big step, and hopefully a warrant of arrest will be issued by the I.C.C. against Duterte and his cohorts.”

Mr. Duterte, who has bragged about personally killing criminals as mayor of Davao, won the presidency promising to fill Manila Bay with the bodies of drug addicts. After taking office, he urged the police to kill drug suspects and promised to protect officers from prosecution. Thousands of Filipinos were killed by the police, in what the authorities said were shootouts, or by unidentified gunmen.

Last year, after an outcry over the killings of three teenagers by police officers, Mr. Duterte suspended the police operations and put the antidrug campaign in the hands of the Philippine Drug Enforcement Agency. But he put the police back in charge in December. Last week, the police said that 46 people suspected of using or selling drugs had been killed by the police since then.

That brought the police’s official death toll from the campaign to over 4,000, a number much lower than the estimated 12,000 deaths reported by various international and local rights groups.

Senator Antonio Trillanes, a prominent political foe of Mr. Duterte, said the news of a preliminary inquiry “should jolt Duterte into realizing that he is not above the law. More important, this is the first step for the victims’ families quest for justice.”

Mr. Roque played down the significance of the inquiry, saying that the tribunal prosecutor was “merely exercising his mandate to determine whether there is reasonable basis proceed.”

The tribunal can take cases only if a country’s own judicial system is unable or unwilling to pursue them, a condition that Mr. Roque said did not apply to the Philippines. “We view, of course, this decision of the prosecutor as a waste of the court’s time and resources,” he said.