WASHINGTON — The United States could remain in the Paris climate accord under the right conditions, Secretary of State Rex Tillerson said on Sunday, signaling a shift in tone from the Trump administration, which angered allies with its decision to pull out of the agreement.

President Donald Trump is willing to work with partners in the Paris agreement if the United States could construct a set of terms that are fair and balanced for Americans, Mr. Tillerson said on CBS’ Face The Nation.

Asked if there was a chance the United States could stay in the accord, Mr. Tillerson responded, “I think under the right conditions.”

“The president said he is open to finding those conditions where we can remain engaged with others on what we all agree is still a challenging issue,” Mr. Tillerson said.

Mr. Trump’s national security adviser, H.R. McMaster, struck a similar tone in television interviews on Sunday in which he said Mr. Trump had always been willing to consider changes on the climate pact.

“He left the door open to reentering at some later time if there can be a better deal for the United States,” Mr. McMaster said on ABC’s This Week program.

“If there’s an agreement that benefits the American people, certainly.”

The accord, reached by nearly 200 countries in 2015, was meant to limit global warming to two degrees or less by 2100, mainly through pledges to cut carbon dioxide and other emissions from the burning of fossil fuels.

The Republican president fulfilled his campaign promise to pull out of the 2015 accord in June, when he announced tersely “We’re getting out.”

Mr. Trump maintained the pact would undermine the US economy and national sovereignty and his decision drew anger and condemnation from world leaders.

It takes four years for a country to withdraw from the Paris agreement, so the United States will be a party to the agreement until two days after Mr. Trump’s first term ends.

US officials attended a meeting on Saturday of ministers from more than 30 of the nations that signed the climate change agreement.

The Wall Street Journal reported on Saturday that Mr. Trump’s administration officials said the United States would not pull out of the agreement and had offered to re-engage in the deal.

Mr. McMaster dismissed the report as inaccurate. “He’s out of the Paris climate accord,” he told the Fox News Sunday program.

Mr. Tillerson said Gary Cohn, Mr. Trump’s top economic adviser, was overseeing the issue.

“So I think the plan is for director Mr. Cohn to consider other ways in which we can work with partners in the Paris Climate Accord. We want to be productive. We want to be helpful,” he said.

Mr. Cohn has been part of the “stay-in” accord camp, which included Mr. Trump’s daughter Ivanka and son-in-law, Jared Kushner. Former chief strategist Steve Bannon was one of the main opponents of the accord before leaving the White House last month.

Mr. Trump has said the Paris accord is soft on leading polluters like China and India, putting US industry at risk.

But the Republican president has shown flexibility on some campaign promises, and US allies have been vocal on the importance of the climate accord.

At a July news conference with French President Emmanuel Macron in Paris, Mr. Trump held open the door to a reversal of his decision, saying “Something could happen with respect to the Paris accords.”

“Let’s see what happens.” — Reuters