For those who remember President Trump’s announcement of America’s withdrawal from the Paris climate agreement last summer, it may be surprising that the country is still participating in U.N. climate talks in Katowice, Poland, right now.

There, the United States has gained notoriety not only for sponsoring a fossil-fuel focused event but also for allying with Saudi Arabia and other oil-producing nations to weaken a reference to a key report detailing the swift pace of climate change and just how close we are to key warming thresholds. The change of stance of the United States, which used to be a leader in the talks, has created a vacuum and a re-sorting of alliances that has left progress in doubt.

But aren’t we supposed to be out of this process, you might wonder — rather than trying to scale back its ambitions?

Well, no. The Trump administration could have pursued a more radical means of withdrawal from the Paris agreement, but it is still going by the book — and in this case, that means Article 28 of the Paris agreement. That text specifies that after joining the agreement, a country can’t leave for three years, after which there is a one-year waiting period for the leave to be fully in effect.

Here’s what that actually means for the United States — a timeline that, as we’ll see, has major political resonance.

The Obama administration moved very fast to have the United States formally join the Paris climate agreement, and other countries did as well. That means that the agreement itself legally entered into force on Nov. 4, 2016.

So that’s the day when the clock started ticking for any possible U.S. withdrawal, under the terms of the agreement.

“The U.S. can initiate the withdrawal process as early as of Novem‎ber 4, 2019, which is three years from the date on which the Agreement entered into force for it,” said Susan Biniaz, a former State Department climate negotiator and currently a lecturer at Yale Law School, by email.

There’s a formal process involved for withdrawal, but it is not burdensome. It has to be done in writing, and written notice has to go to the United Nations.

“It would just be probably a letter or something like that from the State Department,” said Dan Bodansky, an international environmental law expert at Arizona State University. “But it would be an official document.”

Assuming the Trump administration is ready to go and files that document at the earliest possible time, another clock starts ticking. After one year passes, the U.S. withdrawal would then be complete and it would quietly, but concretely, leave the agreement.

But the earliest possible day that could come is consequential — at the earliest, Nov. 4, 2020.

Election Day is Nov. 3, 2020.

This is where things get very interesting. If we assume that Trump will be the Republican nominee again, and that any Democrat running against him would want to rejoin the Paris agreement, then the election could potentially put the United States right back in again if the Democrat wins.

Granted, on this timeline, the United States would at least briefly leave the agreement even in the event of a Democratic victory. That’s because the new president is not inaugurated until January 2021.

But after that, reversal could be swift, at least under the Obama administration’s interpretation that the agreement is not one that needs to be submitted to the Senate for ratification.

It would then take 30 days after submission of notice for the United States to rejoin the agreement formally, Biniaz explained. This, again, is based on the text of the Paris climate agreement.

Of course, if Trump wins, and has withdrawn from the agreement formally, then his victory could be expected to cement the U.S. withdrawal.

What this means, clearly, is that unless Trump somehow changes his mind and decides not to withdraw after all, U.S. participation in the Paris climate agreement seems likely to be a live matter of political debate in the next two years, especially after the formal withdrawal paperwork gets filed.

“Climate change could easily be a campaign issue, and then President Trump, if he’s given notice of withdrawal, then the clock starts ticking,” Bodansky said.

In the meantime, if you think U.S. participation in international climate talks has been rather awkward lately, just wait until next year’s annual climate meeting. Negotiations will probably take place next December, though the location is up in the air because Brazil just announced the country will no longer host the meeting.

That meeting could occur right after the United States has formally submitted its Paris withdrawal paperwork but while the country is still in the waiting period for the withdrawal to occur. In other words — on the outs but not quite there yet.

And again, that could then be followed by a major case of international climate whiplash if the United States promptly rejoins. But that’s just the way it goes when you have treaties with formal timelines, and an extremely polarized climate change debate domestically.

It wouldn’t be the first time such a strange reversal has happened in the international arena. Just to give one rather messy example: Iceland, a whaling nation, was a member of the International Whaling Commission for decades. It withdrew in 1992 after the body enacted a commercial whaling moratorium but rejoined (after an extremely close vote) in 2002, with a reservation to the moratorium.

“Countries do withdraw from treaties and rejoin,” Bodansky said. “It does happen.”