MADRID — Spain’s government on Tuesday approved pardons to a group of separatists serving long prison sentences for their involvement in a failed attempt to form a breakaway state in the northeastern region of Catalonia, a major olive branch in a conflict that has long divided the country.

The pardons, approved by the Spanish cabinet and announced at a news conference, made good on recent promises by Prime Minister Pedro Sánchez to reconcile with a separatist movement that in 2017 rocked Spain with an independence referendum. Spain’s courts declared the vote illegal and the government ordered a crackdown, confiscating ballots and even sending in riot squads to beat many who tried to vote.

Officials also ordered wide-ranging arrests, including those of the nine politicians and independence activists, who were originally given sentences between nine and 13 years, on charges that included sedition and misuse of public funds. The prisoners were jailed about three and a half years ago.

In an announcement from the prime minister’s palace, Mr. Sánchez offered a conciliatory tone that signaled a shift from past confrontational stances by the government against the prisoners. He said pardoning them was in the public interest.

“It’s best for Catalonia, it’s best for Spain,” he said.

The government did not offer complete pardons to the prisoners, however, maintaining bans on holding political office for a number of them who previously had been politicians.