In a last major act as president, Barack Obama cut short the sentences of 330 federal inmates convicted of drug crimes, bringing his bid to correct what he's called a systematic injustice to a climactic close.

With his final offer of clemency, Obama brought his total number of commutations granted to 1,715, more than any other president in US history, the White House said. During his presidency Obama ordered free 568 inmates who had been sentenced to life in prison.

“He wanted to do it. He wanted the opportunity to look at as many as he could to provide relief,” Neil Eggleston, Obama's White House counsel, said in an interview in his West Wing office. “He saw the injustice of the sentences that were imposed in many situations, and he has a strong view that people deserve a second chance.”

For Obama, it was the last time he planned to exercise his presidential powers in any significant way. At noon on Friday, Obama will stand with President-elect Donald Trump as his successor is sworn in and Obama's chapter in history comes to an end.

Even as Obama issued the commutations, the White House had been mostly cleared out to make way for Trump. In between carrying out their last duties, the few remaining staffers were packing up belongings as photos of Obama were taken down from the walls of the West Wing corridors.

The final batch of commutations - more in a single day than on any other day in US history - was the culmination of Obama's second-term effort to try to remedy the consequences of decades of onerous sentencing requirements that he said had imprisoned thousands of drug offenders for too long. Obama repeatedly called on Congress to pass a broader criminal justice fix, but lawmakers never acted.

For Bernard Smith, it's a long-awaited chance to start over after 13 years away from his wife and children.

Smith was working at a restaurant in Maryland in 2002 when his brother asked him to obtain marijuana for a drug deal. Though it was his brother who obtained the crack cocaine that the brothers then sold along with the marijuana to undercover officers, Smith was charged with the cocaine offense, too.

His 22-year sentence was far longer than his brother's, owing to what the court called Smith's “extensive criminal history” prior to the drug bust. Smith still had 10 years on his sentence when he was notified Thursday that the president, on his last day in office, was giving him another chance.

“He's looking to turn his life around,” said Michelle Curth, his attorney. “He's a good person who, like so many people, got involved in something he's been punished for already.”

Curth said that Smith had learned his lesson and owned up to his crime - he asked for a commutation, she noted, not a pardon, which would have erased the original conviction. She said Smith hopes to get licensed in heating and air conditioning maintenance and has lined up family members to help with his adjustment.

But freedom for Smith is still two years away. Rather than release him immediately, Obama directed that he be set free in January 2019 - two years after Obama has left office - and only if Smith enrols in a residential drug treatment program.

To be eligible for a commutation under Obama's initiative, inmates had to have behaved well in prison and already served 10 years, although some exceptions to the 10-year rule were granted. They also had to be considered nonviolent offenders, although many were charged with firearms violations in relation to their drug crimes.

Obama personally reviewed the case of every inmate who received a commutation, often poring over case files in the evenings or calling his attorneys into his office to discuss specifics. Deputy Attorney General Sally Yates said the administration reviewed all applications that came in by an end-of-August deadline - more than 16,000 in total.

Eggleston said Obama had been particularly motivated to grant clemency to inmates who had turned themselves around in prison. He said one inmate had trained and obtained a commercial driver's licence through a prison programme, despite having a life sentence that all but assured he'd never get to use it.

“The ones who really stuck home for the president and me are the ones who got their GED, they worked, they took courses in anger management, they took courses in getting over drug abuse issues, they remained in contract with their families,” Eggleston said.

Joe Biden and Barack Obama through the years Show all 15 1 /15 Joe Biden and Barack Obama through the years Joe Biden and Barack Obama through the years Joe Biden and Dr Jill Biden watch Barack Obama's farewell speech on 11 January. Obama called Biden his 'brother' Joe Biden and Barack Obama through the years US President Barack Obama speaks alongside US Vice President Joe Biden about the Affordable Care Act AFP/Getty Images Joe Biden and Barack Obama through the years Vice President Joe Biden and President Barack Obama Getty Joe Biden and Barack Obama through the years President Obama listens to Joe Biden speak of his work on defeating cancer on 18 October in the White House Reuters Joe Biden and Barack Obama through the years U.S. President Barack Obama is applauded by House Speaker Paul Ryan and Vice President Joe Biden while delivering his final State of the Union address to a joint session of Congress in Washington Reuters Joe Biden and Barack Obama through the years U.S. Vice President Joe Biden interjects as President Barack Obama delivers remarks at a reception for the 25th anniversary of the White House Initiative on Educational Excellence for Hispanics at the White House in Washington REUTERS Joe Biden and Barack Obama through the years Obama and Vice President Joe Biden react after a heckler was removed for their extended interruption (Reuters) Joe Biden and Barack Obama through the years U.S. President Barack Obama shakes hands with Speaker of the House John Boehner (R) as Vice President Joe Biden looks on Joe Biden and Barack Obama through the years Barack and Michelle Obama and Vice-President Joe Biden observing a moment of silence outside the White House to mark the 13th anniversary of the 9/11 attacks Getty Images Joe Biden and Barack Obama through the years Barack Obama and Joe Biden putt on the White House putting green Getty Joe Biden and Barack Obama through the years President Barack Obama and Joe Biden in April 2013 AFP/Getty Images Joe Biden and Barack Obama through the years January 1, 2013: U.S. President Barack Obama winks as he arrives with Vice President Joe Biden (L) in the briefing room Reuters Joe Biden and Barack Obama through the years President Barack Obama, Vice President Joe Biden and others receive an update on the mission against Osama bin Laden in the Situation Room of the White House May 1, 2011 in Washington, DC Getty Images Joe Biden and Barack Obama through the years Vice-President Joe Biden, right, confirmed that the US was looking at ways of taking legal action against Julian Assange - back in December 2010 GETTY IMAGES Joe Biden and Barack Obama through the years Joe Biden, left, and retired military officers watch President Barack Obama sign orders to close down the detention centre at Guantanamo Bay, Cuba, in January 2009 GETTY IMAGES

Obama has long called for phasing out strict sentences for drug offences, arguing they lead to excessive punishment and incarceration rates unseen in other developed countries. With Obama's support, the Justice Department in recent years directed prosecutors to rein in the use of harsh mandatory minimums.

Earlier in the week, Obama commuted most of the rest of convicted leaker Chelsea Manning's sentence, arguing the Army intelligence analyst had shown remorse and already served a long sentence.

Yet Obama will leave office without granting commutations or pardons to other prominent offenders who had sought clemency, including accused Army deserter Sgt. Bowe Bergdahl and former Illinois Gov. Rod Blagojevich. He also declined to pardon former National Security Agency contractor Edward Snowden.