House Speaker Nancy Pelosi on Wednesday slammed the rogue trip by two House members to Afghanistan during the ongoing and dangerous military evacuation effort from Kabul. 

Pelosi, D-Calif., said Reps. Peter Meijer, R-Mich., and Seth Moulton, D-Mass., wanted to "freelance on their own" when the pair of lawmakers this week traveled to Afghanistan without the approval of the leadership. She said the trip put them at risk and strained resources that should have gone to evacuating Americans and others.

"This is deadly serious," Pelosi said at a Capitol news conference Wednesday. "You do not want members to go."

PELOSI WARNS AGAINST LAWMAKERS' TRIP TO AFGHANISTAN: 'UNNECESSARILY DIVERT NEEDED RESOURCES'

Moulton previously challenged Pelosi's leadership when he led unsuccessful efforts in 2017 and 2019 to find an alternative Democratic leader, but he backed Pelosi's speakership this year. Meijer is a freshman GOP congressman who bucked his party's leadership when he voted for former President Trump's impeachment for the Jan. 6 riot. 

Moulton and Meijer, both military veterans, defended their secret trip to Kabul as necessary oversight and not a way to grandstand.  

"Like many veterans, we have spent the last few weeks working without sleep to try to get as many people as we could through the gates and to safety," Moulton and Meijer said in a joint statement. 

In this Oct. 14, 2020, file photo, then-Michigan's 3rd District Congressional Republican candidate Peter Meijer speaks at a campaign rally in Grand Rapids, Mich. (AP Photo/Carlos Osorio, file)

They expressed frustration that America won't be able to complete the evacuation by President Biden's planned Aug. 31 withdrawal date.

AFGHANISTAN ‘TRAGEDY’: TWO VETERAN CONGRESSMEN FROM OPPOSING PARTIES AGREE, SHARE CONCERNS

"Washington should be ashamed of the position we put our servicemembers in – they represent the best in America," the lawmakers said. "These men and women have been run ragged and are still running strong. Their empathy and dedication to duty are truly inspiring. The acts of heroism and selflessness we witnessed … should make America proud."

The pair of lawmakers have received blowback from their colleagues for the trip. 

In this Tuesday, Feb. 12, 2019 ,file photo, Rep. Seth Moulton, D-Mass., speaks at the Brookings Institution in Washington about his vision for the future of U.S. foreign policy. (AP Photo/Carolyn Kaster, File)

Rep. Gregory Meeks, D-N.Y., the chairman of the House Foreign Affairs Committee that would typically sign off on international visits, said he was surprised and shocked by the secret trip. Florida GOP Rep. Brian Mast, a veteran, said the unannounced trip can create a dangerous situation and another headache for the U.S. troops in Kabul.

CLICK HERE TO GET THE FOX NEWS APP

Minority Leader Kevin McCarthy, R-Calif., told Fox's "America's Newsroom" Wednesday he understands the frustration the two members felt about the situation in Afghanistan but he didn't condone their secret trip.  

"I don't think it's the best decision because you put people in jeopardy as a member of Congress," McCarthy said. 

Meanwhile, Pelosi lamented the Taliban takeover of Afghanistan and how strides made by women in education and leadership during the last 20 years are now under "threat."

"This is a tragic situation," Pelosi said. 

Fox News' Caroline McKee contributed to this report.