President Obama on Thursday commuted the sentences of eight people serving lengthy time for crack cocaine convictions, part of the administration’s effort to reduce what it views as “unduly harsh” sentences for drug crimes and eliminate overcrowding in federal prisons.

Each of them had served at least 15 years and had been convicted prior to the 2010 Fair Sentencing Act, which seeks to reduce the sentencing disparity between those convicted of crack and powder cocaine crimes, according to the White House.

Under that law, the same individuals would have received shorter prison terms and, in some cases, completed their time, Obama said in a statement.

The president’s decision came after the Justice Department recommended the cases to the White House. Obama had previously commuted a sentence in only one case, ordering the release two years ago of Eugenia Jennings, who was sentenced in 2001 to 22 years in prison for distributing cocaine.

“In several cases, the sentencing judges expressed frustration that the law at the time did not allow them to issue punishments that more appropriately fit the crime,” Obama said Thursday. “Commuting the sentences of these eight Americans is an important step toward restoring fundamental ideals of justice and fairness.”

Among those whose sentences were shortened is Reynolds Allen Wintersmith Jr., a first cousin of Massachusetts Gov. Deval Patrick (D), who is a close Obama political ally. Wintersmith was given a life sentence in 1994 for dealing crack. The White House said there was no indication Patrick contacted the Justice Department or the White House, and that the relationship had no effect on the president’s consideration of Wintersmith’s case.

A Patrick administration official said the governor, who is two decades older than Wintersmith, has no recollection of ever meeting him. “If they did meet it, would have been when Mr. Wintersmith was a small boy,” said the official, who spoke on condition of anonymity to discuss private family matters. “The governor was not involved in any application for a commutation of Mr. Wintersmith’s sentence, and only learned of the commutation through today’s media reports.”

The White House also announced that Obama had granted pardons to 13 people, including four in Virginia. Their offenses included distribution of illegal drugs, wire fraud, money laundering and bank embezzlement.

Obama, who has now pardoned a total of 52 people, has used the presidential pardon far less frequently than his predecessors. George W. Bush had pardoned 97 people at the same juncture in his presidency, and Bill Clinton had pardoned 74.

The Justice Department has been pushing to reduce the burgeoning prison population, which has grown by about 800 percent since 1980, during which time the country’s population has increased by about a third.

Federal, state and local authorities spend nearly $83 billion each year on corrections, law enforcement officials say. To maintain its prisons, the federal government alone spends $6.4 billion a year — 25 percent of the entire Justice Department’s annual budget.

In his statement, Obama called on Congress to make more changes to sentencing laws to “ensure that our taxpayer dollars are spent wisely, and that our justice system keeps its basic promise of equal treatment for all.”

The effort has received bipartisan support, with Republican governors in some of the most conservative states leading the way. Sen. Rand Paul (R-Ky.) praised Obama for “finding justice for individuals given excessive sentences for nonviolent crimes.”

Paul also pushed for more action to reduce mandatory minimum jail terms, saying on his Twitter account that commuting a handful of cases doesn’t “solve the problem.”

Sen. Charles E. Grassley (Iowa), the ranking Republican on the Senate Judiciary Committee, who expressed skepticism last month at a hearing on the practice of commuting sentences to let prisoners out early, declined to comment.

The American Civil Liberties Union, which featured three of the people whose sentences Obama commuted in a report titled “A Living Death: Life Without Parole for Nonviolent Offenses,” said it was “thrilled” by the action.

Also among those whose sentences Obama commuted is Clarence Aaron, who drew three life sentences without parole for his role in a drug deal when he was 23 in 1993. The ACLU report said Aaron, a football player at Southern University in Baton Rouge, was convicted on three cocaine-related charges even though he was neither the buyer nor seller of the drugs.

“Unfortunately, there are still thousands of people behind bars serving extreme and unfair sentences in the federal and state prison systems,” the ACLU said in a statement.

Sari Horwitz contributed to this report.