WASHINGTON — President Obama said Friday that he has “full confidence” in John Brennan, the director of the CIA, despite Brennan’s admission this week that his agency improperly searched the computers of the congressional committee that is preparing to release a report on the U.S. use of torture in the fight against terrorism.

The president’s comments came in a news conference in which Obama also hailed recent economic improvements, expressed pessimism about efforts to halt the violence in Israel and the Gaza Strip, and complained about Republican inaction in Congress.

Obama said his administration has tried to confront the many crises at home and around the world, and should get more credit for the effort, even when positive outcomes are not immediately apparent.

“We try — we go in there and make an effort,” Obama said of his administration’s work to end violence and conflict around the world. “I tell you what, there isn’t any other country that’s going in there and making those efforts.”

Unlimited Digital Access. $1 for 4 weeks.

The president took direct aim at congressional Republicans, who he blamed for standing in the way of measures that could help accelerate growth and respond to the problems of immigration, transportation funding and middle-class incomes. He urged lawmakers to return from their summer vacations in September ready to take some action.

“My hope is, is that instead of simply trying to pass partisan message bills on party lines that don’t actually solve problems, they’re going to be willing to come together to at least focus on some key areas where there’s broad agreement,” Obama said.

The president mocked the disagreement that has often erupted between factions of Republicans in Congress, saying that much of the gridlock in Washington politics is the result of intraparty feuding among Republicans in the House and Senate.

“The argument isn’t between me and the House Republicans. It’s between the House Republicans and Senate Republicans, and House Republicans and the business community, and House Republicans and the evangelical community,” Obama said.

Noting the Republican failure to pass a bill to confront the recent border crisis, the president said: “That’s not a disagreement between me and the House Republicans. That’s a disagreement between the House Republicans and the House Republicans.”

The president spoke as fighting intensified between Israelis and Palestinians in the Gaza Strip. He demanded that Hamas release a captured Israeli soldier unconditionally, but acknowledged that the seizure of the soldier just after the last cease-fire was to go into effect made it difficult for Israelis to trust in any future truce. He added that Hamas had to discipline its own side if it hoped to advance its interests.

Asked about the upcoming release of a report that documents U.S. interrogation techniques, Obama said the CIA exercised “very poor judgment” in its handling of the report. But he said Brennan had apologized for the incident to Sen. Dianne Feinstein, the chairwoman of the Senate intelligence committee.

“I have full confidence in John Brennan,” Obama said, noting an inspector general’s conclusions about the CIA spying on the committee. “It’s clear from the IG report that some very poor judgment was shown in how that was handled. Keep in mind that John Brennan was the one who called for the IG report.”

Obama also said the report on interrogation techniques documents the country’s use of torture after the Sept. 11 attacks. He said the report makes clear that “we tortured some folks” in the aftermath of those attacks.

“We did some things that were contrary to our values,” he said. “I understand why it happened. I think it’s important when we look back to recall how afraid people were after the twin towers fell.” He said that “a lot of those folks were working hard under enormous pressure and were real patriots.”

But, he added: “We crossed a line. That needs to be understood and accepted. And we have to, as a country, take responsibility for that so that hopefully we don’t do it again in the future.”