WASHINGTON (AP) — President Donald Trump's comments about Afghanistan this week devolved into a history lesson gone awry and an embrace of the former Soviet Union's decision to invade the country in the 1970s.

Trump argued that the Soviets' foray into Afghanistan was the right thing to do, even though he said it "bankrupted" Moscow and led to the demise of the Soviet Union. He said the invasion targeted terrorists who were flowing into the Soviet Union. Actually, the Soviets were trying to bolster communists in Afghanistan and possibly expand their influence against the United States and the West.

A look at some of his statements Wednesday during a Cabinet meeting:

SOVIET INVASION OF AFGHANISTAN

TRUMP: "The reason Russia was in Afghanistan was because terrorists were going into Russia. They were right to be there."

THE FACTS: His assertion that the Soviets were experiencing a terrorist influx from Afghanistan is out of step with history.

While Trump might personally agree with Russia's decision to invade Afghanistan in 1979, the United States at the time did not. The U.S. boycotted the 1980 Olympics in Moscow in protest and the U.N. General Assembly voted 104-18 to deplore the Soviet intervention in Afghanistan.

At the time the U.S. supported the anti-communist rebels, known as mujahedeen, whom President Ronald Reagan called freedom fighters. The U.S. believed that the Soviet Union wanted to strengthen the communists but also that it wanted access to a warm water port through Afghanistan to the Arabian Sea.

Maybe the "terrorists" Trump was talking about were the Afghan insurgents who were rebelling against a communist-led party that staged a coup inside Afghanistan in 1978. The Soviet Union was trying to bolster that party and subsequently sent in 100,000 troops to occupy the country and fight insurgents.

The United States actually took the side of Afghans fighting against Soviet forces, providing them with shoulder-fired rockets that allowed them to shoot down Soviet helicopters and planes. That further burdened the Soviets and increased their human and military losses. The Soviets pulled out of Afghanistan in 1989, the same year that the Berlin Wall fell. The Soviet Union crumbled in 1991.

Story continues

"Praising Soviet invasion of #Afghanistan is an insult to the anti-communist struggle," tweeted Husain Haqqani, a former Pakistani ambassador to the United States.

Trumps comments come as Russian lawmakers weigh historical revisionism on Afghanistan.

Before Feb. 15, the 30th anniversary of the Soviet withdrawal from Afghanistan, Russia's legislature is to vote on a resolution stating that the invasion was conducted according to the "norms of international law." This would nullify a resolution passed in 1989 that condemned the invasion.

___

TRUMP: "Russia used to be the Soviet Union. Afghanistan made it Russia, because they went bankrupt fighting in Afghanistan."

"The problem is it was a tough fight. And literally, they went bankrupt. They went into being called Russia again, as opposed to the Soviet Union. You know, a lot these places you're reading about now are no longer a part of Russia because of Afghanistan."

THE FACTS: That's an oversimplification. It's true that the money the former Soviet Union spent on military and weapons in its competition with the West to wield influence around the world, including in Afghanistan, accelerated its demise. But Russia's intervention in Afghanistan was far from the sole reason for the breakup. The dissolution of the Soviet Union in 1991 occurred in a time of ethnic and political troubles, economic woes and a series of revolutions that led Soviet republics to seek their independence.

___

ISLAMIC STATE GROUP IN AFGHANISTAN

TRUMP: "You do have terrorists, mostly Taliban, but ISIS. I mean, I'll give you an example. So, Taliban is our enemy. ISIS is our enemy. ... Taliban is here, ISIS is here, and they're fighting each other. I said, 'Why don't you let them fight?' Why are we getting in the middle of it? I said, 'Let them fight. They're both our enemies. Let them fight.'"

"It's the craziest thing I've ever seen. I think I would've been a good general, but who knows. But you know what? These are two enemies that are fighting against each other, and we end up going in and fighting. And what are we doing?"

THE FACTS: It's true that IS militants are fighting the Taliban for influence in some parts of Afghanistan, but keeping Afghanistan from becoming a safe place for extremists was the very reason the U.S. intervened in the country.

The U.S. intervention was a response to the Sept. 11, 2001, attacks. The Afghan Taliban had given al-Qaida militants a place to train and embolden its forces to launch attacks on the United States and other targets.

The U.S. continues to keep 14,000 American servicemen and women in Afghanistan to execute counterterrorism missions against extremists to prevent a repeat of 9/11 and train and advise Afghan security forces, which are leading the fight against the Taliban.

___

Associated Press writer Kathy Gannon in Islamabad contributed to this report.

___

Find AP Fact Checks at http://apne.ws/2kbx8bd

Follow @APFactCheck on Twitter: https://twitter.com/APFactCheck

EDITOR'S NOTE _ A look at the veracity of claims by political figures