As the Justice Department investigates how U.S. guns were allowed to flow illicitly into Mexico under the watchful eyes of federal agents, President Obama said today in an exclusive interview with ABC News that “people who have screwed up will be held accountable.”

“Our overarching goal consistently has been to say we’ve got a responsibility not only to stop drugs from flowing north, we’ve also got a responsibility to make sure we are not helping to either arm or finance these drug cartels in Mexico,” Obama said in the interview with ABC News senior White House correspondent Jake Tapper that will air on “Nightline.”

“It’s very upsetting to me to think that somebody showed such bad judgment that they would allow something like that to happen,” he said. “And we will find out who and what happened in this situation and make sure it gets corrected.”

The full Tapper interview with Obama will air tonight on “Nightline” at 11:35 ET.

Obama and Attorney General Eric Holder have come under scrutiny by some Congressional Republicans who allege high-ranking administration officials were aware of the program, known as “Fast and Furious,” and its flaws, but did not intervene.

Of the thousands of guns involved in the operation, several reportedly have ties to violent crimes in Mexico and along the U.S. border, including the murder of U.S. Border Patrol agent Brian Terry.

Earlier this month, Obama said he has “complete confidence” in Holder to oversee a Justice Department investigation into the gun-running operation.

“I have complete confidence in him, and I’ve got complete confidence in the process to figure out who, in fact, was responsible for that decision and how it got made,” Obama said at a news conference Oct. 6.