President Trump said Saturday that he will nominate a woman in the next week to fill Justice Ruth Bader Ginsburg’s seat on the Supreme Court, opening a ferocious political battle that could transform the nation’s highest court and alter the presidential election.

At a rally Saturday night in Fayetteville, N.C., Trump told supporters that he had not yet chosen a nominee, but “it will be a woman, a very talented, very brilliant woman.” The crowd chanted “Fill that seat!”

Even as flags were lowered to half-staff and mourners filled the plaza of the Supreme Court where Ginsburg served for 27 years as a liberal icon, the president and Senate Majority Leader Mitch McConnell (R-Ky.) contemplated her successor.

As he was leaving the White House on Saturday evening, Trump said that an announcement could come within a week and that he prefers a Senate vote before the election.

“We want to respect the process,” he said. “I think it’s going to go very quickly, actually.”

At the rally, he said: “There’s a lot of time. You’re talking about January 20th, right?”

In a call with McConnell, Trump mentioned two female appellate court judges — Amy Coney Barrett, 48, of the U.S. Court of Appeals for the 7th Circuit and Barbara Lagoa, 52, of the 11th Circuit — as favorites, according to people familiar with the matter who spoke on the condition of anonymity to discuss private deliberations. Two other judges — McConnell’s favorite, Amul Thapar, 51, of Kentucky and the 6th Circuit and 38-year-old Allison Jones Rushing of the 4th Circuit — are in a small group that is being given a close look.

All were nominated by Trump to their present positions and have wide support in the conservative legal establishment that has advised the president on his judicial picks. Lagoa, who served briefly on the Florida Supreme Court, had the easiest confirmation, where a majority of Democratic senators supported her in an 80-to-15 vote.

As he was leaving the White House, Trump called Barrett “very highly respected.” Asked about Lagoa, the president said: “She’s an extraordinary person. I’ve heard incredible things about her. I don’t know her. She’s Hispanic and highly respected. Miami. Highly respected.”

The choice, along with whether McConnell can persuade GOP senators to confirm a nominee after voting has begun in the presidential election, will be central in the national debate. Sen. Lisa Murkowski (R-Alaska) has said the seat should remain open for the next president, and Sen. Susan Collins (R-Maine) adopted that position in a statement Saturday.

The death of the liberal icon Ginsburg, 87, might be felt immediately. The court is considering a Trump administration request to reimpose restrictions on medication abortions that a judge relaxed during the pandemic.

Ginsburg’s death surely will be a factor in the court’s docket in the term that begins Oct. 5 — another challenge to the Affordable Care Act is scheduled for after the election, and Ginsburg was a member of the majorities that twice turned back such challenges. Her absence will affect everything from the cases the court accepts to Chief Justice John G. Roberts Jr.’s power as the court’s pivotal member.

Liberals and Democrats accused Trump and the GOP of rank hypocrisy in even considering replacing Ginsburg so close to a presidential election.

McConnell kept the Senate from even holding a hearing on Judge Merrick Garland in 2016 after President Barack Obama nominated him to replace Justice Antonin Scalia, who died in February of that year. McConnell said the next president should make the choice.

Democratic presidential nominee Joe Biden was quick with a reminder. “This was the position that the Republican Senate took in 2016, when there were nearly nine months before the election,” Biden said. “That is the position the United States Senate must take now, when the election is less than two months away.”

But McConnell said things are different when one political party controls the White House and the Senate, and Senate Judiciary Committee Chairman Lindsey O. Graham (R-S.C.), whose committee would consider the nomination, said he was ready to act.

Graham backtracked on his 2018 pledge to allow any vacancy that occurs in a presidential election year to go unfilled. He said he will support Trump “in any effort to move forward regarding the recent vacancy created by the passing of Justice Ginsburg.”

Democrats on the committee urged him in a letter Saturday not to renege on his original pledge, which he said at the time should be used against him.

“There cannot be one set of rules for a Republican President and one set for a Democratic President, and considering a nominee before the next inauguration would be wholly inappropriate,” the Democratic senators said.

Should Republicans proceed, Senate Minority Leader Charles E. Schumer (D-N.Y.) said in a meeting with Democratic senators, the tables will turn if Biden wins and Democrats take over the Senate.

Liberal Democrats and activist groups have been urging that seats be added to the court, something Biden has resisted — and Ginsburg said she opposed.

The next step is most likely to be determined by a complex mix of presidential and senatorial political concerns.

Still, a Trump replacement for Ginsburg can hardly be overstated in its implications for the court’s docket, the influence of Roberts and perhaps even the outcome of the election, if what is shaping up to be one of the most contentious presidential elections in history ends up before the justices.

The assumption would be that Trump’s choice would be as conservative as his previous two — Neil M. Gorsuch and Brett M. Kavanaugh. One would have to go back to 1991, when conservative Clarence Thomas took the place of civil rights icon Thurgood Marshall, to find a succession with more dramatic consequences.

A successful nomination could give conservatives a 6-to-3 majority. Recent liberal victories at the court on issues such as gay rights, abortion and affirmative action have come because the four liberals were able to attract one conservative justice to join them.

Last term, that justice most often was Roberts. A conservative chosen by President George W. Bush, Roberts has shown he is willing to put aside personal inclinations to enhance the court’s reputation as a more incrementalist and nonpartisan body.

Most famously, he found a way to uphold the Affordable Care Act in 2012 against constitutional challenge, earning the lasting hostility of the right.

In the last term, he used his position in the middle — with four justices more conservative and four more liberal — to guide the court to a mix of outcomes. He joined the liberals to strike down a restrictive Louisiana abortion law and to stop the Trump administration from pulling protections for hundreds of thousands of undocumented immigrants who had been brought to the United States illegally as children.

He wrote both of the opinions rejecting Trump’s claims of immunity from a New York prosecutor and congressional committees for his personal financial records.

But the addition of a more conservative justice will shift that middle position elsewhere, perhaps to Kavanaugh.

Just after the election, the court will hear a case involving foster-care services in Philadelphia that involves the scope of religious exemptions to discrimination laws that protect gay couples. In the Obamacare case, the administration is asking the court to strike down the entire law after a lower court’s ruling.

The pitched political battle over Ginsburg’s replacement raged even as tributes to the pathbreaking justice — just the second woman to serve on the Supreme Court — continued.

Crowds have gathered in front of the Supreme Court since her death was announced by the court Friday night. Some mourners brought signs, including one that portrayed Ginsburg as a saint.

Elizabeth LaBerge, 36, wrapped her arms around her fiance, Will Sullivan, laid her head on his shoulder and quietly sobbed.

“I was telling my fiance, the question that keeps popping up in my head is, ‘Who is going to take care of us?’ ” said LaBerge, a lawyer who lives on Capitol Hill. “It just feels like such a deep loss at this particular time. It’s a lot to put on a woman of her age to keep us safe and functioning as a constitutional democracy.”

Details on funeral and memorial services for Ginsburg have not been announced by the court. The Supreme Court said only that “a private interment service will be held at Arlington National Cemetery.”

But current and former members of the court released their own tributes. Justice Stephen G. Breyer, 82, now the senior liberal justice, described her as a “rock of righteousness.” Sonia Sotomayor and Elena Kagan described her importance to women. Justice Clarence Thomas served with Ginsburg on the U.S. Court of Appeals for the D.C. Circuit and had a warm relationship with her, despite their polar-opposite views. As she became more frail, he often gently guided her from the bench after oral arguments.

“She was a superb judge who gave her best and exacted the best from each of us, whether in agreement or disagreement,” Thomas wrote.

Retired Justice David H. Souter, who Ginsburg sometimes cajoled into joining her at Washington social events, summed up their relationship in two sentences.

“Ruth Ginsburg was one of the members of the court who achieved greatness before she became a great justice,” he wrote. “I loved her to pieces.”

Michael Miller and Clarence Williams contributed to this report.