WASHINGTON — President Trump is considering pulling out of a major trade agreement with South Korea as he tries to fulfill get-tough campaign pledges on international trade. But he has not yet made a final decision, two senior administration officials said Saturday.

The president’s top economic advisers remain deeply divided over a possible withdrawal from the United States-Korea Free Trade Agreement, as negotiators from both countries struggle to rewrite the five-year-old deal.

The debate comes as the United States and South Korea are working together to try to combat a growing nuclear threat from North Korea, which said on Sunday that it had tested a hydrogen bomb that could be mounted on an intercontinental ballistic missile. It is a more powerful weapon than the atomic bomb it had tested in the past.

In recent days, a frustrated Mr. Trump has pushed his staff to take bold action against a host of governments, including the one in Seoul, that he has accused of unfair trade practices. But many of his more moderate advisers, including the chairman of the National Economic Council, Gary D. Cohn, believe that such a move could prompt a trade war that could hurt the United States economy.