KOST, AFGHANISTAN- July 2: Refugees wait in line for food and shelter in Khost Province, Afghanistan, July 2, 2014. (Photo by Kevin Sieff/ The Washington Post) (Kevin Sieff/The Washington Post)

Ryan Crocker, a former ambassador to Afghanistan and Iraq, is dean of the Bush School of Government and Public Service at Texas A&M University.

During the wars in Iraq and Afghanistan, thousands of brave citizens of both countries assisted our efforts, at great risk to themselves and their families. Many were killed because they stood with us. Many more faced serious threats. Now we have a moral obligation to stand with them by ensuring that those who need it have the opportunity to live safely and securely in the United States, a country they served at considerable risk even though it was not their own.

This is a matter of deep personal concern to me. When I became ambassador to Iraq in 2007, we had no special immigrant visa (SIV) program for our employees, and only a tiny number of those who served with us were being admitted into the United States as refugees. When I left two years later, a congressionally authorized SIV program was up and running, and more than 17,000 Iraqi refugees had entered the United States the previous year. I launched a similar effort after I became ambassador to Afghanistan in 2011.

As Secretary of State John Kerry noted last month in an op-ed for the Los Angeles Times, the Afghan SIV program suffered its share of bureaucratic problems and delays. Kerry ordered an overhaul of the process, and the results were dramatic; since October, nearly 5,000 Afghans have received visas, compared with roughly 1,600 in the previous year. Sadly, however, the Iraq SIV process has gone in the opposite direction. Although more than 15,000 visas have been issued in all, the flow has slowed to a trickle. George Packer reported in the New Yorker that 507 Iraqis arrived in the United States on SIVs in October. In June, the number was just 53. More than 1,600 Iraqis are waiting, and the program expires in September. Although Congress has mandated that SIV applications be processed within nine months, the actual wait can be more than twice that, Packer reported.

In Afghanistan, a new SIV crisis has arisen. About 6,000 applicants are in the pipeline, but Congress has set a limit of 3,000 visas for 2014, a cap the State Department will reach this month. New legislation is needed immediately to extend the program and provide additional admissions.

In a time of intense political acrimony, I am pleased that this issue is gathering bipartisan support. Sens. John McCain (R-Ariz.) and Jeanne Shaheen (D-N.H.) introduced legislation this week to provide 1,000 additional visas this year, and Rep. Earl Blumenauer (D-Ore.) is spearheading a similar effort in the House. But time is of the essence. In a sense, the State Department has been a victim of its own success in working its way to a more effective system.

The department badly needs to improve its game in Iraq as well. Arguably, those who have worked with us have never been in greater danger than they are now, with the Islamic State, a far more lethal organization than al-Qaeda, controlling large areas of the country and radical Shiite militias emerging elsewhere. Just as they are most needed, SIV operations in Baghdad have ground to a virtual halt. Processing SIVs must be a top priority in Baghdad and Washington, and the personnel and resources needed to expedite issuances must be made available now. This is literally a life-or-death issue. And since extensive backlogs cannot be cleared by September no matter how much effort is made, Congress must extend the Iraq program, too.

Taking care of those who took care of us does not mean doing them a favor. It means acting on fundamental American values. Afghans and Iraqis risked their lives to support our efforts, and all too many gave their lives. A searing memory of my time in Baghdad is the kidnapping and brutal murder of two Iraqi employees of the embassy, a husband and wife. They died because they worked for us.

Wars don’t end just because we bring our troops home. They don’t end for enemies who may gain ground, and they don’t end for friends who may face risks precisely because they were our friends. We must do everything possible to bring our friends in Iraq and Afghanistan to safety.

This will require swift action by Congress and the Obama administration. Anything less would not be just a betrayal of those who served us with courage and dedication. It would be a betrayal of who we are and what we stand for as Americans.