A secret nighttime military mission authorised by US president Barack Obama to rescue Americans held captive in Syria failed early this summer when a team of two dozen Delta Force commandos raided an oil refinery in the northern part of the country but found after a firefight with Islamic militants that there were no hostages to be saved.

US officials - speaking a day after the Islamic State posted a video showing the American journalist James Foley being beheaded - described what they called a “complicated operation” in which the commandos were dropped by helicopter into Syrian territory in an attempt to rescue Mr Foley and others being held by the Sunni militant group.

The Army commandos fought their way to the spot where they believed the Islamic State was hiding the hostages but when the team swooped in, the hostages were gone.

“We’re not sure why they were moved,” a defence department official said. “By the time we got there, it was too late.” The official said it may have been “a matter of hours, perhaps a day or two” since the hostages had been there.

One of the commandos was slightly wounded in the skirmish, which lasted several minutes before US aircraft flew the soldiers to safety. At least one of the aircraft came under fire, but all members of the team were evacuated successfully. The administration officials said they believed a number of the terrorists were killed.

The officials revealed the mission in a conference call with reporters, in which they spoke on the condition of anonymity because of the classified nature of the operation. It was the first time that the US government had acknowledged that American forces had operated inside Syria since the civil war there began.

Two defence department officials, who spoke separately on the condition of anonymity because of the operation’s delicate nature, expressed anger at the administration for revealing the mission.

One of the officials said the aborted raid had alerted the militants to the Americans’ desire and willingness to try to rescue the hostages, and, in the aftermath, had probably forced the captors to tighten their security.

But, the official said, the conference call last night revealed new details that the Islamic State was not likely to have known. “This only makes our job harder,” the official said. “I’m very disappointed this was released. We knew any second operation would be a lot harder.”

Caitlin Hayden, the National Security Council spokeswoman, said the administration had “never intended to disclose this operation” but had felt that its hand was forced by news media outlets that were preparing to report on the mission.

“An overriding concern for the safety of the hostages and for operational security made it imperative that we preserve as much secrecy as possible,” Ms Hayden said in a statement last night.

Lisa Monaco, the president’s chief counterterrorism adviser, said that Mr Obama approved the mission because intelligence officials feared for the hostages’ lives. “The US government had what we believed was sufficient intelligence, and when the opportunity presented itself, the president authorised the department of defence to move aggressively to recover our citizens,” she said.

The officials in the conference call said the administration had kept the mission secret in an attempt to “preserve future opportunities” to conduct another one.

Ms Monaco repeated a call for the immediate release of the hostages and said the failed rescue mission should stand as further evidence of the lengths the United States will go to protect its citizens. “Their effort should serve as another signal to those who would do us harm that the United States will not tolerate the abduction of our people, and will spare no effort to secure the safety of our citizens and to hold their captors accountable,” she said.

Officials declined to say exactly how many hostages the commandos were trying to rescue or to provide the names of the people who they believed were being held captive by the militants.

New York Times