WASHINGTON — Justice Anthony M. Kennedy’s decision to retire, giving President Trump another opportunity to carry out his vow to select Supreme Court nominees who would “automatically” overturn Roe v. Wade, threatens to imperil the 1973 decision that established the constitutional right to have an abortion.

The move also promised to reshuffle the landscape for reproductive rights in the United States, setting the stage for a bitter political and legal struggle that could affect generations of women.

For decades, Justice Kennedy has been seen by supporters and opponents of abortion rights as a crucial swing vote, the deciding force on a profoundly polarized court who weighed in at key moments to preserve the core of Roe.

“Kennedy was the firewall for abortion rights for as long as he was there,” said Mary Ziegler, a professor at the Florida State University College of Law who has written extensively on Roe and its aftermath. “He has been the defining force in American abortion law since the ’90s, so his absence means that Roe will be much more in peril.”