The United States must confront Russia for providing weapons to the Taliban for use against American-backed forces in Afghanistan, top U.S. military officials said Monday.

At a news conference with Defense Secretary Jim Mattis at his side, Gen. John Nicholson, the American commander in Afghanistan, wouldn’t provide specifics about Russia’s role in Afghanistan. But said he would “not refute” that Moscow’s involvement includes giving weapons to the Taliban.

Earlier Monday, a senior U.S. military official told reporters in Kabul that Russia was giving machine guns and other medium-weight weapons. The Taliban are using the weapons in the southern provinces of Helmand, Kandahar and Uruzgan, according to the official, who briefed journalists on intelligence information on condition of anonymity.

Russia denies that it provides any such support to the Taliban, which ruled Afghanistan until the U.S.-led invasion in 2001. Russia says contacts are limited to safeguarding security and getting the hard-line religious fundamentalists to reconcile with the government — which Washington has failed for years to advance. Russia also has promoted easing global sanctions on Taliban leaders who prove cooperative.

Asked about Russia’s activity in Afghanistan, where it fought a bloody war in the 1980s and withdrew in defeat, Mattis alluded to the increasing U.S. concerns.

“We’ll engage with Russia diplomatically,” Mattis said. “We’ll do so where we can, but we’re going to have to confront Russia where what they’re doing is contrary to international law or denying the sovereignty of other countries.”

“For example,” Mattis told reporters in the Afghan capital, “any weapons being funneled here from a foreign country would be a violation of international law.”

Mattis met with President Ashraf Ghani and other senior government officials just hours after the nation’s defense minister and Army chief resigned over a massacre of more than 140 Afghan troops at a military base last Friday.

The insurgent assault was the biggest ever on a military base in Afghanistan, involving multiple gunmen and suicide bombers in army uniforms who penetrated the compound of the 209th Corps of the Afghan National Army in northern Balkh province on Friday, killing and wounding scores. The death toll was likely to rise further.

Referring to the Russians again, Nicholson said “anyone who arms belligerents who perpetuate attacks like the one we saw” isn’t focused on “the best way forward to a peaceful reconciliation.”

Given the sophisticated planning behind the attack, he also said “it’s quite possible” that the Pakistan-based Haqqani network was responsible. The Taliban claimed it carried out the attack.

Nicholson recently told Congress that he needs a few thousand more troops to keep Afghan security forces on track to eventually handling the Taliban insurgency on their own. The Trump administration is still reviewing possible troop decisions.

Mattis on Monday offered a grim assessment for Afghan forces fighting the Taliban.

“2017 is going to be another tough year,” he said.

Kabul was the final stop on Mattis’ six-nation, weeklong tour. He is the first member of President Donald Trump’s Cabinet to visit Afghanistan. As part of the administration’s review of Afghan policy, Trump’s national security adviser, Army Lt. Gen. H.R. McMaster, visited Kabul last week to consult with Nicholson and Afghan officials.

The war began in October 2001. The U.S. has about 9,800 troops in Afghanistan. They ended their combat mission against the Taliban in 2014 but are increasingly involved in backing up Afghan forces on the battlefield.