With three of the surviving Supreme Court justices in or near their 80s, successors named by the next president could shift the ideological makeup of the nation’s highest court.

Within hours of Justice Antonin Scalia’s death Saturday at age 79, President Barack Obama and Senate Republicans began to clash over whether he should nominate, and the Senate confirm, a successor during a presidential election year.

Scalia, nominated by President Ronald Reagan, had served on the Supreme Court since September 1986.

Three of the eight remaining justices are age 77 or older.

The oldest, Ruth Bader Ginsburg, turns 83 next month. She was named by President Bill Clinton.

Anthony Kennedy, also named to the court by Reagan, will turn 80 by Election Day. Stephen Breyer, another Clinton appointee, will be 78 by then.

The remaining four justices range in age from 55 to 67.

A president’s nominees to the Supreme Court must be confirmed by the Senate with a simple majority of at least 51 votes.

So what do the justices’ ages have to do with the court’s ideological balance?

Half of the surviving eight justices were nominated by conservative presidents and half by liberal presidents. Before Scalia’s death, the makeup of the court—generally leaning right—had not changed since Elena Kagan, nominated by Obama, joined in 2010.

Since 1971, the average age of retirement for a Supreme Court justice has been 78.7, according to a 2006 study published in the Harvard Journal of Law and Public Policy. Before 1971, the average age for a justice to leave office was 68.3.  

Because the Supreme Court justices are appointed for life, in essence they either retire or die in office. (In 1804, the House of Representatives impeached Justice Samuel Chase, but he later was acquitted in a Senate trial.)

A 2010 study on the retirements and deaths of Supreme Court justices concluded that the odds that a justice will retire increase by 168 percent when the incumbent president is from the same political party as the president who nominated the justice and the presidential administration is in its first or second year.

The same study found that justices are more likely to die in office if the incumbent president is not from the same political party as the president who nominated them, The Washington Post reported in 2014.

Living justices who retired are John Paul Stevens (who retired in 2010 at 90), David Souter (in 2009 at 69), and Sandra Day O’Connor (in 2006 at 75).

According to the Associated Press, before 1900, two-thirds of justices died in office. Since 1900, it’s only about a third.

Scalia’s death marks only the third time in more than 50 years that a Supreme Court justice has died in office, USA Today reported.

The last one was Chief Justice William Rehnquist, who died at 80 in 2005.