The priests were arrested as part of an ongoing crackdown on the Catholic Church following mass anti-government protests in 2018.
A government statement released late on Wednesday said the 12 were flown to Rome in the afternoon, following “fruitful conversations” with Catholic leaders in Nicaragua as well as with unnamed individuals in the Vatican.
The statement said the deal showed “the permanent will and commitment to find solutions”.
President Daniel Ortega, a leftist who has been in power since 2006, has sought to crack down on opposition since 2018 when social security cuts triggered mass antigovernment protests.
Ortega has maintained that the church aided the protests, which he considered an attempted coup, and this year stepped up a crackdown on Catholic clergy and church-affiliated institutions.
He has previously accused church leaders of seeking to overthrow his government, while judicial authorities have arrested priests and accused some of committing treason, among other crimes.
Nicaraguan clergy have also reported government surveillance of services and assaults.
In February, Bishop Rolando Alvarez, who criticised the 2018 crackdown and was ultimately arrested during a pre-dawn church raid in 2022 for allegedly “organising violent groups”, was sentenced to 26 years in prison on treason charges.
His sentencing came shortly after 222 political prisoners were sent to the United States in a deal brokered by the US government.
Alvarez had refused to get on that flight. Nicaragua’s government later stripped those prisoners of their citizenship.
His name was not among the 12 priests flown to Rome on Wednesday.
Ortega, who has been in and out of power since 1979, when he helped lead the overthrow of the Somoza family dictatorship, has been accused of dismantling Nicaragua’s fragile democracy.
Last month, the United Nations-appointed Group of Human Rights Experts on Nicaragua said the human rights situation had worsened in the previous six months, citing the erosion of academic freedom and closure of universities.
In August, the government seized property and assets belonging to the Jesuit-run Central American University (UCA), one of the country’s foremost institutions of higher education.
University officials said their institution had been accused of functioning as a “centre of terrorism”.
The UN panel said it was one of 27 private institutions to have had their legal status cancelled in recent years.
About 43 percent of Nicaragua’s population is Catholic, with the number declining amid a rising interest in evangelical churches, the US State Department said in its most recent report on religious freedom in Nicaragua.