WASHINGTON — A crazed gunman shot two National Guard troops in a cowardly “ambush”-style attack — leaving them in critical condition — just blocks from the White House on Wednesday, according to law enforcement sources and officials, who promptly confirmed that the suspect was in custody.

The gunman rounded the corner and 17th and I Streets outside the Farragut West Metro Station in Northwest DC around 2:15 p.m. before ambushing the pair of Guard members and opening fire, Metro Police Department executive assistant chief Jeffery Carroll said at a press conference.

“There were other members that were in the area. They were able to, after some back and forth, subdue the individual and bring them into custody,” added Carroll. “Within moments, members of law enforcement in the area were also able to assist and bring that individual into custody.”

The armed soldiers exchanged gunfire with the shooter, and were joined by other guardsmen stationed nearby, who rushed to the area after hearing shots ring out along with local law enforcement.

Photos in the aftermath of the horrifying daylight assault showed one of the troops was shot in the head near Farragut Square, a bustling public park with restaurants and retail shopping stores in between the Farragut West and Farragut North metro stations.

Glass was strewn about the crime scene from the bursts of gunfire as bystanders rushed for cover in what Carroll called “a targeted attack.”

FBI Director Kash Patel declared that the bureau and its law enforcement partners would use “all of our resources to make sure we find the perpetrators responsible for this heinous act,” vowing they will be brought to justice.

“Please send a prayer to those brave warriors .. they are the heroes of this day, and we must remember them every day and remember their sacrifice,” he said at a press conference in the hours following the shooting.

West Virginia Gov. Patrick Morrisey posted on X around 3:40 p.m. that both service members from his state had “passed away from their injuries,” but 20 minutes later added that he was “receiving conflicting reports about the condition of our two Guard members and will provide additional updates once we receive more complete information.”

Mayor Bowser ignored a reporter’s shouted question about the apparently premature post and subsequent walk-back.

Authorities confirmed at a 4:45 news conference that the two guard members were transported to a hospital in critical condition. They also said the unidentified suspect — who was hauled away nearly naked in an ambulance — had acted alone.

Two National Guard troops were shot Wednesday, just blocks from the White House. AFP via Getty Images

ATF officers are seen after reports of the shooting near the White House in Washington. AP

Law enforcement sources told The Post that the suspect, who has not been identified, was shot four times.

Tourist Tim Moye of Newton, Ga., said he was about a block away from the shooting when it happened — and heard two gunshots, a brief pause, and then three more. A rush of people ran his way and said “somebody was shooting.”

A parking garage attendant a half block away said he heard about eight shots before rushing inside along with many pedestrians.

“It’s scary,” said a clearly shaken uniformed worker, speaking in broken English as she ventured out of her workplace near K St, the major road synonymous with DC lobbying.

A member of the Secret Service stands behind yellow police tape after the shooting. AFP via Getty Images

Members of law enforcement and National Guard soldiers respond to a shooting near the White House. Getty Images

DC’s Metro Police Department confirmed the shooting occurred a little after 2:30 p.m. at 17th and I Street, NW, and that the suspect was in custody. FBI, ATF and Secret Service agents also responded.

DC’s Metro Police Department confirmed the shooting occurred a little after 2:30 p.m. Getty Images

A Washington Metropolitan Police officer directs pedestrians after reports of two National Guard soldiers being shot. AP

“Our entire state grieves with their families, their loved ones, and the Guard community,” West Virginia Gov. Patrick Morrisey wrote on X. ” We will demand full accountability for this horrific act.” AP

Both President Trump and Vice President JD Vance were outside of DC at the time of the shooting, with Trump in Florida and Vance visiting troops in Kentucky.

“The animal that shot the two National Guardsmen, with both being critically wounded, and now in two separate hospitals, is also severely wounded, but regardless, will pay a very steep price,” Trump posted on his Truth Social.

“God bless our Great National Guard, and all of our Military and Law Enforcement. These are truly Great People. I, as President of the United States, and everyone associated with the Office of the Presidency, am with you!”

Secretary of War Pete Hegseth said the shooting would “only stiffen our resolve” as he announced another 500 troops would be deployed to join the more than 2,000 National Guard members in DC.

The gunman fired on the soldiers at Farragut Square in Northwest DC, less than a half mile north of the White House. AP

At least one of the National Guard service members was administered CPR, law enforcement sources added. The suspect is also now at a DC hospital.

A ground stop was later issued at Ronald Reagan National Airport outside DC for departing flights over security concerns.

“The White House is aware and actively monitoring this tragic situation. The President has been briefed,” White House Press Secretary Karoline Leavitt added in a statement shortly after the gunfire.

Follow The Post’s live coverage of President Trump and national politics for the latest news and analysis

Two National Guard troops were shot near the White House on Wednesday, according to a report. X / @KellieMeyerNews

Members of the US Secret Service were photographed responding to the incident, Newsmax’s Mike Carter posted on X. X / @ConservBrief

DC’s Metro Police Department confirmed the shooting occurred at 17th and I Street, NW, but didn’t share how many victims were involved.  AFP via Getty Images

Members of the US Secret Service were photographed responding to the incident after a barrage of gunfire rang out near Farragut Square, about a five minute walk from the executive mansion.

One source counted at least 20 shell casings at the scene immediately afterward.

Preliminary reports noted that members of the National Guard were targeted and that a suspect appeared to be in custody. AFP via Getty Images

An aerial view of the scene where the shooting occured. Citizen APP

The Post has reached out to the National Guard, FBI, Secret Service and DC police reps for comment.