The Biden administration admitted Thursday that should not have posted a picture showing the faces of members of an elite U.S. Army Special Forces unit on assignment in Israel when it posted a photo of them in uniform shaking hands with the president.

Apologizing for the mishap, a White House spokesperson told Fox News, "As soon as this was brought to our attention, we immediately deleted the photo. We regret the error and any issues this may have caused."

The photo was posted on the White House's Instagram account late Wednesday and included the faces of four special forces soldiers as they met Biden, who was on his high-profile trip to Israel at the time amid its ongoing war with Hamas.

JERUSALEM DEPUTY MAYOR DEMANDS ‘PROOF OF LIFE’ OF HOSTAGES, ASSURANCE BEFORE BIDEN HUMANITARIAN AIDE HITS GAZA

President Joe Biden

President Joe Biden joins Israel's Prime Minister for the start of the Israeli war cabinet meeting, in Tel Aviv on October 18, 2023, amid the ongoing battles between Israel and the Palestinian group Hamas. (BRENDAN SMIALOWSKI/AFP via Getty Images)

"In Israel, President Biden met with first responders to thank them for their bravery and the work they're doing in response to the Hamas terrorist attacks," the caption below the photo read.

The post received hundreds of thousands of views before finally being taken down about an hour later.

The Department of Defense's usual practice is to blur the photos of soldiers belonging to elite units of the U.S. military in official photos to protect their identities for safety and operational security reasons.

HOUSE REPUBLICANS PROBE BIDEN ADMIN'S RESPONSE TO FOREIGN TERROR THREAT AT BORDER AFTER HAMAS ATTACKS ISRAEL

Biden next to Netanyahu

Social media users trashed the Biden administration on Thursday after it shared an image of President Biden greeting U.S. troops in Israel without hiding the soldiers' identities.  (BRENDAN SMIALOWSKI / Contributor)

The blunder illicited sharp criticism from Republicans with some blasting the White House as incompetent.

The Republican National Committee's Alec Sears ridiculed the White House's blunder on X, formerly Twitter. 

"So funny that the ‘Adults in charge’ are so on top of things they doxxed one of our most elite fighting forces in the midst of their deployment to the Middle East," Sears wrote.

CLICK HERE TO GET THE FOX NEWS APP

Fox News' Peter Doocy contributed reporting.