The Saudi military student who shot and killed three people on Friday at a naval base in Florida was part of U.S. foreign military training programs that go back decades at bases and colleges. Military officers, usually handpicked by leaders in their home countries, receive training in U.S. military doctrine and tactics — including how to use U.S.-made weapons, which often their countries have purchased — as well as instruction in the American political and legal systems.

Since the end of World War II, the Pentagon, the defense industry and others have championed these programs as a crucial way to cultivate allies, boost military partnerships and maintain reliable channels for U.S. arms sales.

After Friday’s attack, however, some U.S. lawmakers have raised questions about the vetting processes in place. Here’s what you need to know:

How many Saudis study in these U.S. programs?

Friday’s assailant, Ahmed Mohammed al-Shamrani, was at Naval Air Station Pensacola on one of more than 5,500 temporary visas issued to Saudi military personnel by the State Department in 2019, according to department data. As of Friday, there were 852 Saudis in the United States for Pentagon-sponsored training related to security cooperation. That represents 16 percent of the 5,181 students from 153 countries in these programs, according to Defense Department spokesman Chris Garver. Pensacola is just one of more than 150 military schools and installations where these students study annually.

Overall, between 2009 and 2018, the State Department issued more than 980,000 temporary, nonimmigrant visas to Saudi nationals, the highest rate for any country in the Middle East after Israel. Most of those visas were for students and tourists, although some also went to military personnel.

Saudi Arabia is a major recipient of U.S. military aid and assistance, a core component of Washington and Riyadh’s decades-long geopolitical and economic ties that has partly shaped the course of the Middle East.

In recent years, Saudi Arabia has largely funded its students on these programs through foreign military sales and other contracts, according to the Congressional Research Service.

What do they study?

Shamrani was in Pensacola through a U.S. Air Force Foreign Military Sales training course funded by Saudi Arabia. He started in 2017 and was on course to conclude in August 2020. The program included training in English, basic aviation and piloting.

Military students from Kenya, Nigeria, Togo, India, Oman, Tunisia, Fiji, Haiti, Indonesia, Malaysia, Mauritius and the Philippines have also studied at Pensacola, according to the State Department.

Saudi Arabia is one of the world’s largest purchaser of arms, and many of these weapons are manufactured in the United States. At Naval Air Station Pensacola, foreign military personnel can receive training on aircraft such as the F-15 fighter and the C-130 cargo plane, which are among the items Saudi Arabia has purchased.

Other coursework offered for Saudis through these programs have included leadership training for senior naval officers, The Washington Post’s Dan Lamothe reported.

What is the vetting process like?

Foreign military personnel in the United States on Defense Department-related training are first nominated by their host country and then assessed by Pentagon officials. The vetting process includes an in-country screening and database checks for any ties to terrorist-related activity, drug trafficking, corruption and other criminal conduct, officials said.

“The way that program works is that the foreign government has to certify that these are the best of their best, that these are their future generals and admirals and senior military officials for their countries,” Rep. Matt Gaetz (R-Fla.), told USA Today. “The U.S. State Department does a scrub on those prospective trainees, and after that they matriculate into the program.”

He added: “That’s a really important part of what our military does because it has people use our systems and train alongside our military members. They are more receptive and more capable and more willing to work with us when the time arises, should U.S. interests be impacted.”

What problems have these programs faced?

Earlier this year, the Pentagon canceled a training program for Afghan pilots in Texas after about 40 percent of the students were reported absent without leave. The Afghans who did not leave the course were sent back to Afghanistan to complete training.

A similar program for Afghan pilots at an air base in Georgia is also facing high desertion rates and is expected to end next year.

Some have criticized these programs for not emphasizing enough coursework on issues such as human rights or for helping to train officers that prop up authoritarian systems.

Egyptian President Abdel Fatah al-Sissi, a former general and defense minister, is one of many prominent military and political leaders who have studied in the United States on these programs. He has maintained close ties with the Trump administration as he leads brutal crackdowns on dissent in Egypt.

For years, the United States ran what was formerly called the School of Americas — now the Western Hemisphere Institute for Security Cooperation — a Spanish-language training base for Latin American generals and officers. The list of graduates includes some Latin American and Caribbean political and military leaders accused of human rights abuses in the 1970s and 1980s, including former Panamanian strongman Manuel Antonio Noriega and Salvadoran death squad organizer Roberto D’Aubuisson. The School of the Americas closed in 2000 and changed its name, and its curriculum was revamped.

“According to critics, the school had abusive graduates that violated human rights. They maintained that soldiers that were chosen to attend were not properly screened, with the result that some students and instructors attended the school even after being implicated in human rights violations. … The manuals discussed forms of coercion against insurgents, including execution and torture,” the Congressional Research Service wrote in 2001.

What’s been the fallout of Friday’s attack?

So far, some lawmakers have called for reforming the vetting process and for Saudi Arabia to compensate the victims.

President Trump, meanwhile, has taken a relatively conciliatory tone on Twitter surrounding the shooting after speaking with Saudi Arabia’s King Salman.

“The King said that the Saudi people are greatly angered by the barbaric actions of the shooter, and that this person in no way shape or form represents the feelings of the Saudi people that love the American people,” Trump tweeted.

Trump has kept close ties with Saudi Arabia, despite the conclusion of U.S. intelligence that the kingdom’s crown prince was behind the 2018 murder of Washington Post contributing columnist Jamal Khashoggi, a critic of some Saudi policies and an advocate of democracy in the region.