President Obama carries a binder containing material on potential Supreme Court nominees as he walks toward the residence of the White House on Friday. (Kevin Lamarque/Reuters)

It was not so long ago that many observers were arguing that it was time to slide Barack Obama’s presidency onto the bookshelf labeled “history.”

The president’s political capital seemed spent, and the man himself seemed tired. He looked and sounded like a lame duck.

Then, bam! A confluence of events has conspired to keep the president not just relevant but also vital, even as the campaign to replace him intensifies.

The unexpected Supreme Court vacancy, a historic trip to Cuba and a deeply unsettled presidential primary campaign all promise to keep the president at the center of Washington politics and policy debate deep into his final year in office.

The president seems to be relishing his continued place in the spotlight. He is doling out media interviews and holding forth at length on a wide range of topics. One moment, Obama is opining on Donald Trump’s odds of winning the election; another moment he is angling for a late-inning score on budget items and Puerto Rico debt restructuring; and another he is pondering a successor for the late Supreme Court justice Antonin Scalia.

A group with People for the American Way gathers with signs Monday in front of the Supreme Court, calling for Congress to give fair consideration to any nomination put forth by President Obama. (Carolyn Kaster/AP)

And deploying a bit of sports jargon, he has said that lots of things can happen in the fourth quarter.

Only recently, many people were writing him off. “He starts his last year with a key goal: remaining relevant,” Reuters wrote on the eve of the State of the Union address. “Obama Reaches for Relevance With $4.1 Trillion 2017 Budget,” said a Bloomberg News headline recently. “Obama’s presidency now effectively over,” said a Washington Times headline. And as long ago as 2014, a Washington Post writer declared that “all that appears left for the Obama presidency is a narrowing of both vision and accomplishment.”

The White House insists that Obama still has some fight left in him.

The Supreme Court nomination may be the most consequential. The president has indicated that he wants a person with top credentials and someone who has withstood GOP scrutiny in an earlier confirmation for a court seat.

The Cuba trip, too, could outlive his presidency if Obama can extract pledges to further open markets and transform the island nation into a more democratic place.

And he still has a chance to do damage control on foreign issues, such as the war in Syria, for which Secretary of State John F. Kerry is seeking a cease-fire.

But Obama still faces risks in his final year, above all on foreign policy, where he is in danger of becoming captive to what takes place on distant battlefields, conflicts that he will try to side-step. Those include the installation of Chinese missiles in the South China Sea, continuing Russian brinkmanship in Ukraine, chaos in Syria, and lingering troubles in Afghanistan and Iraq. The rightward drift in Israel hardly merits a mention.

President Obama and first lady Michelle Obama stop at a portrait of Supreme Court Justice Antonin Scalia after paying their respects at his casket in the Great Hall of the Supreme Court on Friday. (Pablo Martinez Monsivais/AP)

And at home, he could end up playing more defense on several key issues, such as the Clean Power Plan and the immigration executive order, which are working their way through the judicial system. Some have better chances with an incomplete Supreme Court, while others could fare worse.

Many U.S. presidents have faded early from the political scene. President Woodrow Wilson suffered a stroke in late 1919, and his cherished League of Nations treaty was defeated shortly afterward. President Dwight Eisenhower’s final year was tarnished by the downing of a U-2 spy plane over the Soviet Union, though he left with a memorable farewell address about the “military-industrial complex.”

President Lyndon B. Johnson won passage of fair-housing legislation, the Gun Control Act and a tax surcharge to balance the wartime budget, but these achievements paled next to the war news from Vietnam. “LBJ was a legislative wizard,” said Bruce Schulman, a history professor at Boston University. “By normal standards, he was successful on Capitol Hill as a lame duck, but compared to his earlier legislative success, not so much.”

President Ronald Reagan, having survived the Iran-contra scandal, won confirmation for his Supreme Court nominee, Justice Anthony M. Kennedy. President George W. Bush watched his approval ratings tank — even before the financial crisis took hold.

Others continued to pile up achievements until the very end. President Theodore Roosevelt created Muir Woods and the Grand Canyon national monuments and assured the election of his handpicked successor, William Howard Taft (though they later fell out).

President Bill Clinton, bouncing back from impeachment the year before, tried and failed to forge a Middle East peace deal but managed to win passage of an unpopular trade package with China, granting it most-favored-nation status and making it a member of the World Trade Organization. And he protected a huge budget surplus.

Schulman notes that only 13 American presidents have served eight consecutive years, including five of the first seven. But that list also includes four of the past five. “The last year has recently become a regular phenomenon we now must reckon with,” he said.

As soon as the last midterm elections passed by, Obama seemed liberated. No longer worried about being spurned by his own party members running for election, Obama said he was not done. And a year later, he was reveling in a sense of surpassed expectations.

Filling the empty Supreme Court seat plays right into some of Obama’s favorite themes: the meaning of the Constitution, the need to overcome the partisan divide, and the obstructionism of the Republicans. Whether that is enough is unclear.

“So I just want to point out I said at the beginning of this year that interesting stuff happens in the fourth quarter, and we are only halfway through,” he said in December. “I’m going to leave it out all on the field.”

With the Supreme Court nomination, Obama could be looking at a two-minute drill in which he advances steadily with short-yardage plays, or he could be about to throw a Hail Mary. Where it would land is anybody’s guess.