Despite all that, Obama said, "the majority of people still favor trade. They still recognize, on balance, that it's a good idea."
"If you look at the benefits to the United States or to Germany of free trade around the world, it is indisputable that it has made our economies stronger," Obama said.
The president said he was confident negotiations on the trans-Atlantic trade deal could be completed by the end of year, with ratification to follow. And he said that once the U.S. presidential primary season is over and politics settle down, the trans-Pacific pact, awaiting ratification, can "start moving forward" in Congress.
Obama is pushing to conclude negotiations on the European deal before he leaves office, so that "next president can pick that up rapidly and get that done," he told the BBC in an interview broadcast Sunday.
But it's not certain that the next president would pick up where Obama leaves off on trade. The trans-Atlantic pact has not been a top issue in the campaign to choose Obama's successor. And both leading candidates — Democrat Hillary Clinton and Republican Donald Trump — oppose the Asia-Pacific trade pact for its potential impact on American jobs and wages.
Obama isn't alone in facing opposition on trade. His host and partner on the daylong campaign, German Chancellor Angela Merkel, also is under pressure from critics who claim the trans-Atlantic deal would erode environmental standards and consumer protections.
Thousands of people took to the streets in Hannover to protest the trade deal on the eve of Obama's arrival.
Throughout the day, Obama and Merkel stressed their alignment on trade, as well as other matters.
At a press conference, Obama made a strong public show of support for her handling of the migrant issue, saying she was "on the right side of history on this."
Her decision to allow the resettlement in Germany of thousands fleeing violence in Syria and other Mideast conflict zones has created an angry domestic backlash. Merkel recently helped European countries reach a deal with Turkey to ease the flow, but she and the other leaders are now under pressure to revisit it.
Obama said Merkel was "giving voice, I think, to the kinds of principles that bring people together rather than divide them."
But Obama would not go so far as to back her support for establishing a "safe zone" in Syrian territory, saying that would be difficult to put in place.
"As a practical matter, sadly, it is very difficult to see how it would operate short of us essentially being willing to militarily take over a big chunk of that country," he said. "And that requires a big military commitment."
Merkel has endorsed the notion of creating areas that could provide safe haven for the thousands of migrants fleeing the violence, and said such zones would improve access to humanitarian aid. She insisted the proposal would not require outside intervention, saying safe areas should be part of the Geneva peace negotiations that involve the Syrian government and moderate opposition groups.
Obama — looking to project a united front with a leader he referred to as his "trusted partner" while she called him "Dear Barack" — said he did support using the peace talks to ultimately create safe areas controlled by the moderate opposition, and on that "there's no space between us."
Obama spoke after Merkel rolled out the red carpet for him at Hannover's Herrenhausen Palace. His stop in Germany was the last on a six-day trip to the Middle East and Europe. The European leg has shaped up as a farewell tour to some of the leaders and the cities he's frequented as president.