A sprawling air base in western Iraq that hosted President Trump during his first visit to a combat zone as commander in chief was one of two military installations where American troops are stationed that came under ballistic missile attack by Iran early Wednesday.

Al Asad Air Base, along with an air base near Erbil in northern Iraq, were targeted in retaliation for a drone strike by the United States on Friday that killed Maj. Gen. Qassim Suleimani, a top Iranian commander who Mr. Trump had maintained was planning “a very big attack and a very bad attack for us.”

The fusillade also came one day after Mr. Trump threatened to attack cultural sites in Iran in response to any reprisals for General Suleimani’s killing. Mr. Trump backed away from the threat earlier Tuesday after being told it would be illegal.

Here’s what we know about the bases and the scale of the attack on Wednesday:

Were there any casualties?

The Pentagon announced that more than a dozen ballistic missiles had been fired at the two bases but said it was still assessing the damage. The editor in chief of Mashregh, the main news website for Iran’s Revolutionary Guards, said more than 30 ballistic missiles had been fired at the American base at Asad.

“The president has been briefed and is monitoring the situation closely and consulting with his national security team,” the White House said in a statement.

Mr. Trump later wrote on Twitter that the assessment of casualties and damages was continuing, and that he would make a statement on Wednesday morning.

How many American troops are in Iraq?

As of December, there were about 6,000 United States troops deployed in Iraq, which is a fraction of the peak number of 150,000 military personnel who served during Operation Iraqi Freedom, which lasted from 2003 to 2011. After General Suleimani’s death, the Iraqi Parliament voted to expel American troops from the country, which Mr. Trump then said would be met with sanctions.

Credit…The New York Times

What is the strategic importance of the Asad air base?

During the past two years, both Mr. Trump and Vice President Mike Pence made unexpected visits to the base, which is in Anbar Province and about 135 miles from the Syrian border. At the time of his visit, which he left for on Christmas night in 2018, Mr. Trump characterized the journey as harrowing and under the cloak of darkness.

“I had concerns for the institution of the presidency because — not for myself, personally,” he said at the time. “I had concerns for the first lady, I will tell you. But if you would have seen what we had to go through, with the darkened plane, with all windows closed, with no lights on whatsoever, anywhere — pitch black. I’ve never seen it. I’ve been in many airplanes — all types and shapes and sizes. I’ve never seen anything like it.”

In 2015, Iraqi security forces repelled an attack on the base by the Islamic State in Iraq and Syria, or ISIS.

The remaining American troops at the base are helping to train Iraqi security forces.

What is the significance of the base near Erbil?

In October, Delta Force commandos stationed at the base started the operation in Syria that led to the death of Abu Bakr al-Baghdadi, the leader of the Islamic State. Eight American helicopters, primarily CH-47 Chinooks, took off from the base, flying low and fast to avoid detection during the mission.

The president, along with Defense Secretary Mark T. Esper, Mr. Pence and Gen. Mark A. Milley, the chairman of the Joint Chiefs of Staff, watched video of the raid piped into the White House Situation Room from surveillance aircraft orbiting over the battlefield. Mr. Pence visited the base in November.

Mr. al-Baghdadi detonated a suicide vest, killing himself and three children, which Mr. Trump recounted with particularly brash language.

“He died like a dog,” Mr. Trump said. “He died like a coward.”