The K-1 visa into the United States, also known as the “fiancé visa,” came under scrutiny in 2015 when it was revealed one of the two shooters in an attack in San Bernardino, California, that killed 14 had entered the U.S. using the visa.

Tashfeen Malik, a native of Pakistan, was granted the visa in 2014 to marry Syed Rizwan Farook, a U.S. citizen. They settled in California, had a baby and in December 2015, conducted a shooting rampage that ended with their deaths.

Some – including many candidates in the 2016 presidential election – criticized the K-1 visa for allowing Malik into the U.S. But getting the visa involves much paperwork, three U.S. bureaucracies, thousands of dollars and takes well over one year to complete.

How to get a K-1 visa

The visa allows U.S. citizens who want to marry non-citizens the opportunity to marry in the U.S. If the application is granted, the citizen and foreign fiancé have 90 days from arrival in the U.S. to marry.

To get the visa, the couple first must have physically met one another within two years preceding the filing of the K-1 visa. Although it is very rarely waived, the meeting requirement can be waived under circumstances that include undue hardship or cultural practice.

The next step is for the U.S. citizen to file for a K-1 visa with the U.S. Citizenship and Immigration Service (USCIS). Multiple forms of documentation must also be submitted showing citizenship and K-1 eligibility.

If the USCIS approves the visa, the Department of State conducts a background check on the foreign fiancé.

If the background check is clear, the fiancé must undergo a medical examination by a doctor approved by the State Department and then attend an interview with a State Department official at a U.S. embassy or consular office in the fiancé’s country. During the interview, the fiancé must provide more documents.

If the fiancé passes the medical exam, interview and document check, the visa will be issued and the fiancé can travel to the United States. Once at a port of entry, the fiancé must be admitted into the U.S. by an official with U.S. Customs and Border Patrol.

All told, the process can cost roughly $1,000 in filing fees and involve three U.S. bureaucracies.

If the couple marries within the 90-day window, the fiancé can apply for permanent resident status (a green card). If the couple doesn’t get married, the fiancé is an illegal immigrant and will be deported.