WASHINGTON (Reuters) - 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, Tillerson said on the CBS’ “Face The Nation.”

Asked if there was a chance the United States could stay in the accord, 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,” Tillerson said.

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

“He left the door open to re-entering at some later time if there can be a better deal for the United States,” said 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 2 degrees or less by 2100, mainly through pledges to cut carbon dioxide and other emissions from the burning of fossil fuels.

FILE PHOTO: U.S. Secretary of State Rex Tillerson speaks during a press conference after talks with Chinese diplomatic and defense chiefs at the State Department in Washington, U.S. June 21, 2017. REUTERS/Kevin Lamarque/File Photo

The Republican president fulfilled his campaign promise to pull out of the 2015 accord in June, when he announced tersely “We’re getting out.” Trump maintained the pact would undermine the U.S. 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 Trump’s first term ends.

U.S. 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 Trump administration officials said the United States would not pull out of the agreement and had offered to re-engage in the deal.

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

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

“So I think the plan is for director 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,” said.

Cohn has been part of the “stay-in” accord camp, which included 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.

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

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

At a July news conference with French President Emmanuel Macron in Paris, 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.”