Yemenis gather at the site of Saudi-led airstrikes in the rebel-held Yemeni port city of Hodeida on Sept. 21. Twenty civilians were killed. (AFP/Getty Images)

Reservations are growing within the Obama administration about American military involvement in Saudi Arabia’s air campaign in Yemen, as some lawmakers and human rights groups charge the United States with responsibility for Saudi attacks that have killed many civilians.

Civilian casualties have spiked in Yemen since the collapse of peace talks in August, the United Nations reported recently, bringing the total number of civilians killed since March 2015, when a coalition led by Saudi Arabia launched its operation against Houthi rebels there, to more than 4,000.

While both sides have been blamed for violence against civilians, the Obama administration now faces increasing pressure to reconsider its military support for a campaign that was supposed to be a short operation focused on defending the Saudi border, but has evolved into an open-ended, offensive war.

“It’s that offensive warfare that raises a lot of questions in policymakers’ minds,” said a senior State Department official who, like others, spoke on the condition of anonymity to comment freely. “Does an ally have to give you a blank check for everything you’re doing in a war?”

Despite repeated strikes on schools and hospitals, officials see little choice for now but continued support, given the intense desire to shore up a bilateral relationship rocked by President Obama’s nuclear deal with Iran and new legislation linked to the Sept. 11, 2001, attacks.

The Yemen campaign illustrates the sometimes uncomfortable collision of American interests in the Middle East and their consequences — in this case, a perception of U.S. indifference to lost lives. Some officials also say the campaign sets a worrisome precedent in which the U.S. military is actively enabling an operation into which it has limited visibility and even less control.

“When we see civilian casualties, it puts us in an extremely awkward position, because Saudi Arabia is a close ally,” another U.S. official said.

Close to two years after Houthi rebels took over Yemen’s capital, Sanaa, aid groups say humanitarian conditions have grown desperate in the already poor nation. About 20 million people need food, medicine, fuel and other basics.

While the Houthis are accused of abuses of their own, aid groups have put forward a long list of alleged attacks by the Saudi-led coalition on civilian facilities.

Medical charity Doctors Without Borders has pulled out of parts of northern Yemen after what it says were a series of Saudi attacks that killed at least two employees and numerous patients.

One reason for high civilian casualties and damage to infrastructure, aid and rights groups say, is the fact that the fighting is concentrated in dense urban areas where it is more difficult to distinguish between targets.

Rep. Ted Lieu (D-Calif.), a colonel in the Air Force Reserve and an attorney, said there is “significant evidence” that the Saudi coalition has committed war crimes in Yemen. “The United States should not be aiding and abetting the slaughter of civilians,” he said.

Lawmakers including Lieu have taken unprecedented steps to challenge Saudi Arabia in recent months. Even though one recent measure, which would have blocked a major arms sale, did not pass, it signaled a shift in congressional attitudes toward a core Middle Eastern ally. Lawmakers dealt a much larger blow recently when they voted to override a presidential veto of legislation that would allow families of 9/11 victims to sue Riyadh over its alleged support to those involved in the attacks.

Officials in the Sunni Muslim kingdom say the campaign is necessary to beat back the advance of regional rival Iran and its Shiite allies in Yemen, who have made incursions into Saudi territory and continue to lob missiles over the border.

“This is a war . . . mistakes could happen,” a Saudi military spokesman told reporters in Germany recently. “We do what is necessary to avoid any mistakes, and if there is a mistake, we have a committee . . . investigate.”

Saudi Arabia, with U.S. support, has set up a board to investigate allegations of civilian casualties, but rights groups said its findings were not credible. Even some within the Obama administration were disappointed by the panel’s initial conclusions.

Scott Paul, a senior policy adviser at Oxfam America, said the U.S. military backing for Saudi operations had practical and symbolic value.

“International support for the coalition has played a huge role in sustaining the war effort, deflecting criticism and granting legitimacy to belligerents who could settle this war peacefully if they wanted to,” he said.

Since spring 2015, U.S. planes have flown more than 1,000 refueling sorties and offloaded tens of millions of pounds of fuel to Saudi aircraft. Officials have also provided advice on target development and avoiding casualties.

But U.S. officials say the extent of American support has been more limited than commonly thought.

While the Pentagon has provided the Saudi military coordinates of “no-strike” locations, including known civilian targets or infrastructure, U.S. lawyers or targeteers do not review Saudi targets ahead of time. U.S. drone imagery is not used to develop targets, and American officials do not help Saudi Arabia select munitions for individual attacks.

Officials say they have little visibility into the kingdom’s “dynamic strikes,” which occur after a shorter review period and now dominate its air operations.

“For better or for worse, they own this campaign,” a senior defense official said. “We want them to prosecute this campaign in a way compliant with the laws of armed conflict and in a way that minimizes casualties in Yemen, but ultimately we have our own campaign that we have to prosecute against the Islamic State.”

From the beginning, military officials have tried to direct their assistance to help Saudi Arabia defend its border, rather than enabling offensive operations deep within Yemen. But they also acknowledge that U.S.-provided weapons are fungible and planes refueled by the United States can conduct multiple missions.

For the Pentagon, grappling with the strains of wars in Iraq, Syria, Afghanistan and Libya, a secondary U.S. role is a natural result of a years-long effort to build up Saudi military capacity. If allies can look out for their own security, officials said, it lessens the need to station American troops across the region.

U.S. officials say that “errors of capability or competence, not of malice” are behind repeated Saudi strikes on civilian targets. Military lawyers have reviewed Saudi actions and say no laws have been violated because, in their view, the civilian deaths appear to be unintentional.

U.S. military officials argue that their presence, weaponry and support have made for a cleaner campaign.

“Those of us who work with the Saudis think that just cutting off sales or cutting off military support is [not] actually going to lead to a better outcome for the Yemeni people,” the defense official said.

Critics say the limited U.S. access does not shield the administration from responsibility for what occurs. “Why would we be refueling a jet carrying bombs if we don’t know what target it’s about to strike?” Lieu said. “If we just refueled a jet that is hitting a hospital, that’s a problem.”

Despite the widespread concerns, many officials see a negotiated end to the conflict, however distant a prospect, may be the only way out of a dilemma with no clear end in sight.

When the operation began, support for a key ally was a foregone conclusion, one official said. “There was this great sense of ‘this is the right thing to do,’ ” the official said.

Over time, attitudes have changed. “The Houthis have shown themselves to be very resilient,” he said. “They’re in it for the long haul.”

Karoun Demirjian contributed to this report.

This story has been updated to correct the amount of fuel offloaded by U.S. planes.