1 of 12
Carolyn Kaster, Associated Press
US President Barack Obama, left, and German Chancellor Angela Merkel are photographed as they meet at Schloss Herrenhausen in Hannover, Germany, Sunday, April 24, 2016. Obama has arrived in Germany to mount a two-day push to sell his trans-Atlantic trade pact.

HANNOVER, Germany — President Barack Obama delivered a strong defense of international trade deals Sunday in the face of domestic and foreign opposition, saying it's "indisputable" that such agreements strengthen the economy and make U.S. businesses more competitive worldwide.

Obama, on a farewell visit to Germany as president, is trying to counter public skepticism about a trans-Atlantic trade deal with Europe, while also facing down criticism from the 2016 presidential candidates of a pending Asia-Pacific trade pact.

Despite all that, Obama said, "the majority of people still favor trade. They still recognize, on balance, that it's a good idea."

"It is indisputable that it has made our economy stronger," Obama said about international trade. He said he was confident the trans-Atlantic trade deal could be completed by the end of year, to be presented for ratification. And he said that once the U.S. presidential primary season is over and politics settle down, the trans-Pacific pact can "start moving forward."

Obama, at a news conference with German Chancellor Angela Merkel, 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 to the kinds of principles that bring people together rather than divide them," and credited her with taking on some tough politics.

But the president reiterated U.S. opposition to the idea of establishing a "safe zone" in Syrian territory, saying it would 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 chunk of that country," he said.

Merkel, in contrast, 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," said making safe zones controlled by moderate opposition part of the peace talks shows that "here there's no space between us."

Obama spoke after Merkel rolled out the red carpet for him at Hannover's Herrenhausen Palace, a rebuilt version of the former summer royal residence destroyed in World War II. After reviewing German troops in a palace garden, they climbed a spiral staircase and stepped inside for private talks.

The two later spoke at the opening of the Hannover Messe, the world's largest industrial technology trade fair, where Obama made the case for swift action on the trans-Atlantic trade deal known as TTIP. The trade pact is a hard sell in much of Europe, particularly Germany.

After three years of negotiation on the deal, Obama said, "we've made important progress but time is not on our side."

"If we don't complete negotiations this year, then upcoming political transitions in the United States and Europe could mean this agreement won't be finished for quite some time," he said.

Thousands of people took to the streets in Hannover to protest the trade deal on Saturday, before Obama arrived. Some carried placards that said "Yes We Can — Stop TTIP!" It was a riff on Obama's 2008 presidential campaign slogan.

In November, more than 100,000 people in Berlin protested against the proposed pact.

Proponents say the deal would boost business at a time of global economic uncertainty. Critics fear the erosion of consumer protections and environmental standards.

Negotiators in Washington and Europe are trying to finalize key parts of the deal before the end of the year, after which Obama's successor and election campaigns in major European countries could further complicate the already difficult negotiations.

Obama said it was important to conclude negotiations even though ratification would be unlikely before he leaves office. "But if we have that deal, then the next president can pick that up rapidly and get that done," he told the BBC in an interview broadcast Sunday.

It's not certain that the next president would pick up where Obama leaves off on the trade deal. The pact has not been a top issue in the campaign to choose Obama's successor. 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.

On Monday, Obama was joining Merkel to tour the trade show and giving a speech on challenges facing the U.S. and Europe.

Merkel also used the occasion of Obama's visit to invite the leaders of France, Britain and Italy to Hannover for a meeting Monday to discuss Syria, Libya, IS, migration and other issues.

Superville reported from Aerzen, Germany. Associated Press writers Kathleen Hennessey and Frank Jordans in Hannover, Germany, contributed to this report.

Follow Darlene Superville on Twitter: http://www.twitter.com/dsupervilleap and Kathleen Hennessey at http://twitter.com/khennessey