MEXICO CITY — A judge in Nicaragua sentenced a Roman Catholic priest to 49 years in prison Friday for the rape of a 14-year-old girl.

Judge Edén Aguilar Castro sentenced Father José Leonardo Urbina to 24 years in prison on two counts of abuse and 25 years for one count of rape.

However, Aguilar Castro ruled that Urbina would serve only 30 years. Nicaraguan law limits maximum sentences in most cases to 30 years.

Urbina served as a priest at the Perpetuo Socorro parish in the town of Boaco, 55 miles (90 kilometers) northeast of the capital, Managua. He was arrested in July on a complaint from the victim’s mother.

The Diocese of Grenada expressed “deep pain and suffering” in a statement about the sentence, and called on the faithful to “continue praying for our jailed priests.”

In June, a parish priest in the southern town of Nandaime was sentenced to two years in prison for supposedly assaulting a woman, but she later retracted the accusation and was accused of perjury.

The sentencing comes amid an unprecedented series of arrests and tension between the government of President Daniel Ortega and the church.

In August, Nicaraguan police raided the residence of Matagalpa Diocese Bishop Rolando Álvarez and arrested him and several other priests who had holed up inside for two weeks after police set up a cordon.

Nicaraguan authorities had earlier accused Bishop Álvarez — an outspoken critic of Ortega’s government — of “organizing violent groups” and inciting them “to carry out acts of hate against the population.”

The government had previously shut down eight radio stations and one television channel in Matagalpa province north of Managua. Seven of the radio stations were run by the church.

Huge street protests across Nicaragua in 2018 called for Ortega to step down. Ortega maintained the protests were a coup attempt carried out with foreign backing and the support of the church. Since then, his government has moved against voices of dissent, including locking up political opposition leaders and shuttering more than 1,000 nongovernmental organizations.

In November, after locking up his potential challengers, Ortega won a fourth consecutive term in elections that foreign governments called a farce. The United States and European Union have imposed sanctions on members of his government and family members.