House Speaker Paul Ryan drew a stark difference between his vision for trade and that of President Donald Trump, rejecting tariffs and warning that pulling out of trade agreements is a threat to the U.S. economy.

“We risk having American products locked out of new markets, jobs moved overseas, and a decline in American influence,” Ryan said Thursday at the Economic Club of Washington. “As our generals will tell you, these agreements are just as important for our national security as they are for our economy.”

Ryan of Wisconsin, who plans to retire after this year, questioned Trump’s decision to pull out of Trans-Pacific Partnership, a multinational agreement to cut trade barriers. Ryan said the pact’s “broader intent was correct,” to counter China’s influence in the region and encourage development according to the U.S. model. Trump rejected the agreement, which was championed by former President Barack Obama.

Ryan said “bad actors” like China commit trade abuses, as Trump has asserted, but that new tariffs “are not the solution.”

Trump announced tariffs on steel and aluminum and this week the administration said it would impose a new round of 10 percent tariffs on $200 billion of Chinese goods as part of a dispute over alleged Chinese theft of U.S. intellectual property. Ryan hasn’t advocated any legislation to reverse the tariffs.

“The rule book for the global economy in the 21st century is being written now—the question is whether the United States will be holding the pen, or will we cede that authority to illiberal, undemocratic regimes,” Ryan said. “We must continue to demonstrate that our way of doing things still has juice.”