WASHINGTON — President Obama is on pace to be the first president in decades to leave office with a federal prison population that is smaller than when he was sworn in, a reflection of eight years of liberal criminal justice policies, historically low crime rates and an aggressive use of presidential commutations.

Mr. Obama granted clemency to 79 federal prisoners on Tuesday, bringing his total to more than 1,000 inmates, most of whom were serving lengthy prison terms under strict sentences imposed at the height of the war on drugs. An additional 13,000 people have been released early by the courts, the Justice Department said.

But looming over the announcement was the fact that President-elect Donald J. Trump’s nominee for attorney general, Senator Jeff Sessions of Alabama, strongly opposed Mr. Obama’s liberal approach to criminal justice. Mr. Sessions favors vigorous enforcement of drug laws and the use of mandatory minimum sentences.

Some of Mr. Obama’s criminal justice legacy is easily undone. Justice Department policies that discourage seeking mandatory minimum sentences by default, for instance, can be torn up. But other changes, such as new sentencing guidelines, will have a lasting effect and will be difficult to reverse, regardless of the administration.