Barack Obama has freed one of the world’s longest-serving "political prisoners" as the outgoing US president uses his last days in office to pardon hundreds of inmates.

Oscar López Rivera, a Puerto Rican independence activist who has been in a US prison for more than 35 years, will be released in May – six years earlier than planned.

The prisoner was placed behind bars in 1981 after being found guilty of “seditious conspiracy” and has been classified as a terrorist by the US government.

Mr Obama has issued record numbers of pardons and commutations during his last weeks in office before handing over to Donald Trump on 20 January. On Tuesday, he announced that Chelsea Manning, the US solider who in 2013 was sentenced to 35 years in prison for passing secret documents to WIkileaks, would be released in May.

López Rivera was part of the Fuerzas Armadas de Liberación Nacional (FALN) armed group, which advocated violence as a tactic in the struggle for Puerto Rican independence and carried out hundreds of bombings in the US.

Now 74, he has spent more than half his life in prison and was due to remain behind bars until June 2023 - when he would have been 80.

During his last days in office in 1999, then president Bill Clinton offered to shorten López Rivera’s sentence but the prisoner rejected the deal because it did not include two of his fellow activists. In 2011, the US Parole Commission turned down his request for early release.

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

A number of high-profile figures have campaigned for his release, including Pope Francis, former US president Jimmy Carter, Archbishop Desmond Tutu and Lin-Manuel Miranda, the creator of hit musical Hamilton.

López Rivera’s lawyer, Jan Susler, broke the news of the release to him.

"He's very, very grateful," she said. "One of the things he said was: 'Tomorrow's my daughter's birthday. What an amazing present for her."'

“We have a lot of work left to do, and now Oscar will be able to join us, and we can work side by side”, Ms Susler later told The Guardian.

Puerto Rico is classified as a US territory but is not officially a US state.

López Rivera spent his early life on the Caribbean island but moved with his family to Chicago when he was 14. He served in the US army during the Vietnam War before becoming closely involved in the struggle for Puerto Rican independence.

US prosecutors claimed FALN had carried out at least 140 bombings on military bases, government offices and financial buildings, but López Rivera has repeatedly denied he was involved in carrying out fatal attacks.

The group later renounced violence.

Asked about this by the Guardian last year, López Rivera said: “We realised other tactics to armed force could be more effective, mobilising people through peaceful campaigning.

Morally, also, we came to see that we had to lead by example, that if we are advocating for a better world then there are things you cannot do. You cannot get a better world by being unjust yourself.”