The U.S. has reached a trade agreement with South Korea that will impose a 15% tariff on imports, including autos, and sets up major investment in American energy and shipbuilding.

The agreement, announced by U.S. President Donald Trump and confirmed by officials in Seoul, brings one of the world’s biggest exporters into Washington’s emerging trade framework and spares a major supplier of cars, smartphones and machinery from a 25% rate just a day before the deadline.

The agreement includes a $350 billion South Korean fund for U.S. investments. The won weakened against the dollar after a bounce at the open, and shares in Seoul erased early gains.