Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

PESHAWAR, Pakistan — A pair of spectacular Taliban attacks in Afghanistan's capital in a seven-day span follow months of incessant bombing by the Trump administration and represent an apparent message to their Islamic State rivals, experts say.

An injured man is carried away after Saturday's attack in Kabul, Afghanistan. Mohammad Ismail / Reuters

More than 100 people died and 234 others were injured when an explosive-laden ambulance detonated in the heart of Kabul on Saturday. On Jan. 20, 22 people were killed in an coordinated strike on the city's Intercontinental Hotel, which is popular with foreigners.

The high-profile attacks in Kabul represent a shift in tactics for the Taliban, which in recent years showed willingness to negotiate peace by setting up an unofficial embassy in Qatar. The group hopes to reimpose its austere version of Shariah law on the country and appears to have been playing a long game — waiting for foreign forces to withdraw from Afghanistan.

“It is an attempt to disprove statements by U.S. and Afghan officials that the Taliban are weakened,” said Borhan Osman, a senior analyst with the International Crisis Group, an organization aimed at preventing and resolving deadly conflict. “They want to say, ‘We are here, we are strong and can shake public confidence in the government’s ability to protect people.’”

“ISIS has conducted many attacks in Kabul since October and the Taliban felt under pressure to respond to that."

The Taliban’s recent attacks come in the wake of President Donald Trump’s expansion of the American air campaign in the country. The number of bombs dropped on the Taliban tripled in 2017.

On Monday, Trump condemned the Taliban for the latest carnage, said the U.S. was not prepared to talk to the group and pledged to "finish what we have to finish."

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

The most recent Taliban attacks are meant to show that winter is not slowing them down, according to Vanda Felbab-Brown, a senior fellow at the Brookings Institution think tank in Washington.

“The level of fear struck in Kabul is much greater given they attacked in the supposedly protected city center," she said. "It shows their prowess and potency.”

This projection of power is not aimed only at foreigners and the government of President Ashraf Ghani, it is also directed at ISIS-linked groups that have set up in the country since 2014, she said.

“ISIS has conducted many attacks in Kabul since October and the Taliban felt under pressure to respond to that,” she said, referring to the smaller ISIS-linked groups that have set up in the east and north of the country.

A U.S. Army helicopter flies over Afghanistan's Helmand province. Andrew Renneisen / Getty Images file

On Dec. 28, ISIS fighters hit a Shiite Muslim center Kabul, killing 41. And on Monday, it claimed an attack on an army garrison in the capital that killed 11.

Osman of the Crisis Group said that while ISIS was a "scary phenomenon," the Taliban remained the single biggest problem.

"Focusing on is [ISIS] is like being scared of a shark attack — it may be deadly but it is not a common threat."

A Taliban commander who spoke to NBC News on condition of anonymity because he was not allowed to speak to the press, said Saturday’s attack had been planned specifically in response to Trump.

“The timing of this attack was very good as we conveyed our message to the Trump administration and his puppet Afghan government that Taliban were still there and can carry bigger attacks anywhere and anytime," said the commander who is affiliated with the Haqqani network, a dreaded militant group that is part of the Afghan Taliban.

Driven from power by the U.S. invasion following the 9/11 attacks in 2001, the group controls or contests around 40 percent of the country's districts, according U.S. figures released in October. The Defense Department has blocked the release of more recent numbers on U.S. progress in the country, a move that the Special Inspector General for Afghanistan Reconstruction on Monday called “troubling” and unprecedented.

Trump’s Afghanistan policy is intended to turn around the 17-year war by boosting government forces, as well as pressuring neighboring Pakistan — which has links with the Taliban — to cooperate. On Jan. 3, the U.S. said it was withholding aid worth hundreds of millions of dollars to Pakistan until Islamabad cracked down on the Taliban and the Haqqanis. Pakistan has long denied helping or sheltering the insurgents.

Afghan government and U.S. air strikes aren’t only killing militants. While militant violence cause most civilian casualties in 2017, deaths and injuries from government and international aerial operations jumped 52 percent in 2017, according to Human Rights Watch.

Mushtaq Yusufzai reported from Peshawar, F. Brinley Bruton reported from London and Ahmed Mengli reported from Kabul, Afghanistan.