KABUL, Afghanistan — Islamic State militants attacked Afghan soldiers guarding a military academy in the capital on Monday, killing at least 11 troops and wounding 16.

The attack, which began before dawn and continued well past daybreak, was the latest in a wave of relentless violence in Kabul this month unleashed by the Taliban and the rival Islamic State group that has killed scores and left hundreds wounded.

President Donald Trump condemned the recent spate of violence, saying “innocent people are being killed left and right,” including children. After previously expressing support for Afghan efforts to reach a political settlement with the insurgent group, Trump said “there’s no talking to the Taliban.”

Trump condemns Taliban role in Afghan attacks, says no talks President Donald Trump told visiting members of the U.N. Security Council on Monday the U.S. would no longer talk with the Taliban following a recent string of deadly attacks in Afghanistan.

Afghan Defense Ministry spokesman Dawlat Waziri said a suicide bomber struck the military unit guarding the academy, setting off a gunbattle. Two of the attackers were killed in the gunbattle, two detonated their suicide vests and one was arrested by the troops, he said.

Waziri confirmed that 11 soldiers were killed. He said “the attack was against an army unit providing security for the academy and not the academy itself.”

The Islamic State affiliate in Afghanistan, which calls itself Khorasan Province, claimed the attack in a statement carried by its Aamaq news agency, saying its fighters targeted the academy.

The academy, known as Marshal Fahim National Defense University, is sometimes called “Sandhurst in the Sand” — a reference to the British academy. Named after Mohammed Fahim, the country’s late vice president and a military commander of the Northern Alliance that fought the Taliban, the academy was inaugurated in 2013 after British forces oversaw the development of its officers’ school and its training program.

× Fear of missing out? Sign up for the Army Times Daily News Roundup to receive the top Army stories every afternoon. Thanks for signing up. By giving us your email, you are opting in to the Army Times Daily News Roundup.

The academy was also the site where the highest-ranking U.S. military officer to be killed in the wars in Afghanistan and Iraq lost his life, in August 2014. Army Maj Gen. Harold J. Greene, then deputy commander of the transition force in the country, was shot and killed by an Afghan soldier in a so-called “insider attack” that was later claimed by the Taliban.

The same academy was also attacked in October last year by a suicide bomber who killed 15 officers. The attacker was on foot and detonated his suicide vest as the on-duty officers were leaving the facility. That attack was also claimed by the Taliban.

President Ashraf Ghani denounced Monday’s attack, saying the “Taliban must choose between Islam and terrorism.”

An Afghan woman leaves the site of an attack at the Marshal Fahim academy in Kabul, Afghanistan Monday, Jan. 29, 2018. Islamic State militants attacked Afghan soldiers guarding the military academy in the capital Kabul on Monday, killing at least 10 troops and wounding 16. (Rahmat Gul/AP)

Neighboring Pakistan also condemned Monday’s attack, saying it “reiterates its strong condemnation of terrorism in all its forms and manifestations, especially the series of heinous attacks within the last week in Afghanistan.”

Both the Taliban and ISIS have stepped up attacks in recent weeks, in what analysts say is a campaign of violence intended to undermine the U.S.-backed government.

On Saturday, a Taliban attacker drove an ambulance filled with explosives into the heart of the city, killing at least 103 people and wounding as many as 235.

The Taliban claimed the ambulance attack, as well as an attack a week earlier in which militants stormed a luxury hotel in Kabul, killing 22 people, including 14 foreigners, and setting off a 13-hour battle with security forces.

Masoom Stanekzai, the head of Afghanistan’s intelligence service, said five suspects have been arrested for their involvement in the hotel attack. A sixth suspect had fled the country, he said. He also said that four people have been arrested in connection with Saturday’s ambulance attack.

The recent attacks have underscored the weaknesses of Afghan security forces more than 16 years after the U.S.-led invasion toppled the Taliban.

They also raise questions about Trump’s strategy for winning America’s longest war, which was announced in August but has changed little on the ground. That strategy was based on ramping up military pressure on the Taliban to eventually force them into peace talks with the government.

But in a meeting with visiting ambassadors on Monday, Trump said “we don’t want to talk with the Taliban.”

The Taliban have been waging an insurgency since they were driven from power by U.S. and Afghan forces after the Sept. 11 attacks. In recent years, they have seized districts across the country and carried out near-daily attacks, mainly targeting Afghan security forces and the U.S.-backed government. They say they are open to direct peace talks with the United States, something Washington has long rejected.

The Islamic State affiliate in Afghanistan emerged in 2014, as the U.S. and NATO were winding down their combat mission and around the time that ISIS declared its self-styled Islamic caliphate, headquartered in Syria and Iraq. Its followers have clashed with both Afghan forces and the Taliban.

Associated Press writers Maamoun Youssef in Cairo and Patrick Quinn in Beirut contributed to this report.