WASHINGTON ― In his last planned speech on national security, President Barack Obama warned his successor against rolling back several of the reforms he made to the way the U.S. wages war against terrorist groups.

Speaking Tuesday from the MacDill Air Force base in Tampa, Florida, Obama defended his legacy ― both from hawks who have accused him of withdrawing from the Middle East, and from liberals who have criticized his reliance on expansive surveillance and drones to fight wars. The outgoing president sought to convince the country that he had struck the correct balance, and encouraged the next administration to follow in his footsteps.

Though he never mentioned president-elect by name, it was clear that Donald Trump was the intended recipient of some of his remarks.

“We’re a nation that believes freedom can never be taken for granted and that each of us has a responsibility to sustain it,” Obama said Tuesday. “The universal right to speak your mind and to protest against authority, to live in a society that’s open and free, that can criticize a president without retribution,” he continued, in an apparent jab at Trump’s tendency to threaten legal action against his critics.

As he defended his own actions as president, Obama zeroed in on several areas where Trump had promised to reverse current policy. Presented as a numbered list, it felt at times like an inventory of the achievements Obama felt were most vulnerable.

Obama defended the Iran nuclear agreement as an international effort that made the world safer ― knowing that in a little over a month, Trump will have the ability to unilaterally scrap years’ worth of diplomatic wrangling.

The outgoing president recalled one of his first moves in office ― the decision to ban torture as a means of interrogation. No military official, Obama said, had told him that the decision had compromised intelligence gathering efforts.

“Despite all the political rhetoric about the need to strip terrorists of their rights, our interrogation teams have obtained valuable information from terrorists without resorting to torture, without operating outside the law,” Obama said.

While campaigning, Trump repeatedly said he would command subordinates to use waterboarding “and worse” to extract information from enemies ― but that move would likely face resistance within the military and intelligence community, and would run counter to U.S. and international law.

In his speech, Obama hailed the U.S. court system as a preferable way to prosecute suspected terrorists than the military commissions at Guantanamo Bay, where pretrial proceedings against the alleged plotters of the Sept. 11 terror attacks drag on indefinitely. He cited Times Square car bomber Faisal Shahzad, Boston marathon bomber Dzhokar Tsarnaev, and underwear bomber Umar Farouk Abdulmutallab as examples of terrorists who have been captured, interrogated without using torture, and convicted in federal courts.

“American juries and judges have determined that none of these people will know freedom again,” Obama said. “But we did it lawfully.”

Individuals accused of plotting attacks abroad, like Abu Khattala, a Libyan suspected of leading the Benghazi attack, and Ahmed Warsame, an alleged al Qaeda leader, have also faced charges in U.S. courts, Obama said. “We can get these terrorists and stay true to who we are.”

The president’s praise of the effort to prosecute and imprison enemies domestically underscored the weight of his failure to close the Guantanamo Bay prison, which Trump has pledged to keep in operation. The president-elect has even suggested he would try American citizens in the ill-functioning war court at Guantanamo.

In his final months in office, Obama has dramatically downsized the prison population at Guantanamo, but he’s been blocked by Congress from transferring any detainees to the U.S. Fifty-nine remain.

Jim Watson/Getty Images In a little more than one month, Donald Trump will replace Barack Obama as commander-in-chief.

At times, Obama’s description of his national security legacy ― which he has framed as a lawful, transparent and diplomacy-first approach to resolving international disputes ― rang hollow.

The president cited a 2013 agreement with Russia over Syria’s chemical weapons program as a diplomatic triumph that “eliminated Syria’s declared chemical weapons program.” While the agreement did remove some of the Assad regime’s stockpile, there have been numerous chemical weapons used since, which human rights groups have assessed were used by Syrian government forces.

In a final effort to push back against critics of his administration’s reliance on drones ― and set a precedent for the Trump administration ― Obama listed on Tuesday what he said were examples of his administration’s commitment to transparency and accountability, even as it oversaw a largely secret targeted killing program.

The president cited the recent decision to release reports about civilians killed in drone strikes outside of war zones ― but the administration’s civilian death count is far less than the numbers recorded by independent observers. He touted the release of a 61-page report that describes the legal justification for ongoing military operations ― but even that report relies on a broad interpretation of the executive branch’s legal authority to wage war with minimal restrictions. The Guardian reported last month that Obama would not tighten the rules governing drone strikes before Trump takes office.

Obama battered lawmakers for failing to “do their jobs” and vote on an updated war authorization tailored to the current fight against the Islamic State. In the absence of a new war authorization, Obama has relied on legislation passed by Congress in 2001, perpetuating the constant war footing that the president has repeatedly said he sought to end.

“Democracies should not operate in a state of permanently authorized war,” Obama said Tuesday. “That’s not good for our military, it’s not good for our democracy.”

Obscured in his rhetoric is the fact that it was Obama, not Congress, who claimed an expansive war-fighting authority under the 2001 AUMF ― and set the precedent for Trump to do the same.

In a rare display of public criticism against a president of his own party, ranking House Intelligence Committee member Adam Schiff (D-Calif.) noted on Twitter Obama’s role in setting the precedent for an all-expansive interpretation of the 2001 war authorization.

.@POTUS right to call out Congress on #AUMF. But Administration is also culpable in expansion of executive power with reliance on 2001 Act. https://t.co/4ByhYyYnyJ — Adam Schiff (@RepAdamSchiff) December 6, 2016