WASHINGTON — President Trump opened the door on Wednesday to lifting some sanctions on Iran in an effort to set up a meeting with that country’s leaders, a softening of his “maximum pressure” campaign against Tehran just a day after the firing of national security advisor John Bolton.

Trump has long claimed that the sanctions would cripple Iran’s economy to the point of forcing its government back to the bargaining table. So far, that has not occurred.

Asked Wednesday by reporters if he would consider easing the sanctions in order to arrange a face-to-face meeting with Iran’s President Hassan Rouhani, Trump would not rule out the possibility.

“We’ll see what happens,” he said.

Trump and Rouhani could meet on the sidelines of the United Nations General Assembly in New York this month. Such a meeting has been under consideration at least since late last month, when French President Emmanuel Macron, at the Group of 7 summit, publicly urged a meeting and Trump indicated openness to the idea.

Bolton often disagreed with Trump’s plans to meet with dictators and autocrats, including those in Iran. His opposition to a meeting between Trump and Rouhani was one of the flashpoints that ultimately led to Bolton’s dismissal on Tuesday, according to a senior administration official.

The departure of his hard-line aide has removed a significant constraint on Trump’s desire to have his way and could presage a new, even more unrestrained phase in the administration’s foreign policy, analysts and officials said.

“Trump has made clear that he’s his own principal advisor,” said David Rothkopf, a professor of international relations who wrote a book about the National Security Council. “Right now I wouldn’t say there’s much of a national security process. And that’s dangerous because the president is inexperienced and erratic.”

Trump has been eager to meet with adversaries in pursuit of diplomatic deals, or at least a showy and dramatic sort of summitry that captures the world’s attention. Since early last year, he often did so against Bolton’s advice.

In addition to their disagreements over Iran, Bolton opposed Trump’s desire to meet with officials of Afghanistan’s Taliban militia at Camp David. After that meeting fell apart late last week, the president blamed Bolton for leaking stories about division in the White House, specifically a report that Vice President Mike Pence had sided with Bolton, which Pence vehemently denied.

In his remarks Wednesday, Trump repeatedly disparaged Bolton, who served as his top White House national security aide for 18 months. He criticized Bolton for comments that complicated his early outreach to North Korean leader Kim Jong Un and for his policy toward Venezuela, which the president has followed but now says he “disagreed” with.

“I don’t blame Kim Jong Un,” Trump said. “He wanted nothing to do with John Bolton.”

Trump also mocked Bolton’s “Mr. Tough Guy” reputation.

“He’s so tough, he got us into Iraq,” Trump quipped.

Whether Iran will now agree to a meeting remains unknown — in the past, important factions in its government have opposed meeting with American officials.

But “the removal of Bolton might be a signal to the Iranians and make them more flexible, more willing to engage,” said Ilan Goldenberg, a former State Department official specializing in the Middle East. “The Iranians think that if they got in a room with Trump, they could get something.”

“Bolton or no Bolton, Trump is interested in talking to the Iranians, and the question is whether the Iranians will talk to Trump,” said Goldenberg, now Middle East director for the Center for a New American Security, a Washington think tank.

Any rapprochement with Tehran would mark a sharp change in course by the administration. Bolton and Secretary of State Michael R. Pompeo have repeatedly denounced what Pompeo called the “malign behavior” of the Islamic Republic.

Pompeo, however, who had a tense relationship with Bolton, has been careful to avoid ever contradicting Trump in public. On Tuesday, shortly after Bolton’s dismissal was made public, he said at the White House that Trump “is prepared to meet with no preconditions.”

Easing up on Iran would also make Israel nervous. Israel’s leaders see Iran as their most threatening enemy, and Prime Minister Benjamin Netanyahu has repeatedly thanked Trump for being tough on Tehran. But, Goldenberg noted, Netanyahu is facing a difficult reelection bid next week, and cannot afford to tangle with Trump.

“There will be quiet anxiety from the Israeli security establishment and Netanyahu’s office, but he is so invested in Trump that he can’t politically afford an argument,” Goldenberg said. “This gives Trump a lot of freedom of movement. He has leverage.”

Trump also clashed with Bolton over his desire to hold peace talks with Taliban leaders.

On Wednesday, Trump again tried to explain his decision to scuttle the possible summit with the Taliban — he says he canceled it, but Taliban leaders say they never planned to come. He threatened the Afghan militants and other enemies with “power the likes of which the United States has never used before.”

During an otherwise solemn speech at the Pentagon commemorating the Sept. 11 anniversary, Trump claimed that the Pentagon and U.S. allies had sharply stepped up attacks on the militants.

“The last four days, we have hit our enemy harder than they have ever been hit before. And that will continue,” he said.

That claim could not be immediately confirmed.

Gen. Kenneth F. McKenzie Jr., who leads U.S. Central Command, told reporters on Monday in Kabul that the Taliban miscalculated by continuing its attacks during negotiations, and there would be a response from U.S. forces.

“I think the pace is probably going to increase because I think their pace has increased which I think was a very bad misjudgment on their part,” he said.

However, it appears that fighting had already intensified. According to the Afghan Ministry of Defense, there have been military operations in 17 of the country’s 34 provinces since the start of the month. Pompeo said Sunday that allied attacks had killed 1,000 Taliban militants “in the last 10 days.”

About 14,000 U.S. troops are deployed in Afghanistan, far fewer than the peak of American involvement there. In addition to advising Afghan forces, they conduct airstrikes and special operations raids.

Neither the White House nor the Pentagon has made clear what the goal would be of any increased attacks. The U.S. has been fighting the Taliban for 18 years without eradicating it or forcing its surrender. By some measures, the Islamist militants control more territory now than at any time since U.S. forces helped push them from power in the wake of Sept. 11.

“What is really the objective of redoubled airstrikes?” asked Bruce Hoffman, a senior fellow at the Council on Foreign Relations in Washington. “Is it degrading the Taliban or is this a ploy to get them back to the negotiating table?”

Afghanistan is scheduled to hold a presidential election Sept. 28, and officials in Kabul have braced for more violence. The Taliban has refused to hold formal talks with the Afghan government, describing it as a puppet regime, and has used car bombs, suicide bombings and other attacks against both civilian and military targets.

Trump said he has called off peace talks with the Taliban, pronouncing the negotiations “dead” on Monday. But it’s not clear what alternative he has — other than a unilateral withdrawal — if he still intends to pull out a significant number of U.S. troops before the 2020 election.

Luke Coffey, who researches foreign policy issues for the Heritage Foundation, a conservative think tank in Washington, said violence around the Afghan election could be a bellwether of whether the U.S.-Taliban talks can restart soon.

“This latest episode will tell us how committed the Taliban is to a negotiated settlement,” he said.

Special correspondent Sultan Faizy in Kabul contributed to this report.