President Biden is taking a victory lap after U.S. forces killed al Qaeda leader Ayman al Zawahri, despite previously opposing military operations targeting terrorist leaders.

Biden told the American public during a televised address Monday that a U.S. drone strike had killed the 71-year-old terrorist leader in Afghanistan.

"To those around the world who continue to seek to harm the United States, hear me now: We will always remain vigilant, and we will act," the president said. "And we will always do what is necessary to ensure the safety and security of Americans at home and around the globe." 

President Biden resting his chin in his hand

President Biden will turn 80 in November. (AP Photo/Susan Walsh)

Biden's comments contrast sharply with the tone he perviously took when it came to targeting terrorists. 

While running for the White House in 2020, in particular, Biden lambasted former President Trump for ordering the assassination of Iranian Gen. Qassem Soleimani. 

ZAWAHRI'S KABUL DEATH RAISES QUESTIONS ABOUT AL QAEDA PRESENCE IN AFGHANISTAN AFTER US LEFT IT TO THE TALIBAN

"No American will mourn Qassem Soleimani’s passing. He deserved to be brought to justice for his crimes against American troops and thousands of innocents throughout the region. He supported terror and sowed chaos," Biden said. "None of that negates the fact that this is a hugely escalatory move in an already dangerous region."

At the time, Biden argued that Trump's decision to take out a high-ranking Iranian military commander risked starting a war between the U.S. and the theocratic regime.  

Qassem Soleimani

Qassem Soleimani, commander of Iran's Quds Force, attends an annual rally commemorating the anniversary of the 1979 Islamic revolution, in Tehran, Iran Feb. 11, 2016. (AP Photo/Ebrahim Noroozi, File)

"The Administration’s statement says that its goal is to deter a future attack by Iran, but this action almost certainly will have the opposite effect," said Biden. "President Trump just tossed a stick of dynamite into a tinderbox, and he owes the American people an explanation of the strategy and plan to keep safe our troops and embassy personnel, our people and our interests, both here at home and abroad, and our partners through the region and beyond. "

Soleimani, a one-time head of Iran’s elite Quds Force, was killed in a U.S. drone in Iraq. Soleimani, according to the State Department, was responsible for orchestrating attacks on U.S. military personnel throughout the Middle East. 

WHITE HOUSE RELEASES IMAGE OF BIDEN HUDDLING WITH ADVISERS AHEAD OF AL-ZAWAHRI STRIKE

Biden expressed reservations about the U.S. raid that killed Usama bin Laden while serving as vice president during the Obama administration. Although Biden has denied opposing the raid in recent years, former President Obama contends otherwise. 

"Joe weighed in against the raid, arguing that given the enormous consequences of failure, I should defer any decision until the intelligence community was more certain that bin Laden was in the compound," Obama wrote in his 2020 memoirs, "A Promised Land." 

U.S. President Joe Biden and former President Barack Obama

President Joe Biden and former President Barack Obama attend an event to mark the 2010 passage of the Affordable Care Act at the White House on April 5, 2022. (Chip Somodevilla/Getty Images)

The president did praise Trump's move against Islamic State leader Abu Bakr al Baghdadi in October 2019.

CLICK HERE TO GET THE FOX NEWS APP

"As the key figure behind the creation of ISIS, Baghdadi’s corrosive message inspired attacks that claimed thousands of innocent lives around the world—including in the United States," Biden said at the time. "The world is better and safer without him in it."

The White House did not respond to a request for comment.