CAIRO — A court in Kuwait on Monday sentenced a prominent opposition politician to five years in prison for insulting the country’s ruler, a crime that leaders around the Persian Gulf are prosecuting with increasing frequency in an effort to stanch emboldened protest movements, or stop protests before they start.

In the last six months, dissidents in Qatar and Saudi Arabia have been imprisoned on charges that included either insulting or disobeying the countries’ leaders. Bahrain’s cabinet on Sunday was reported to have endorsed a penalty of five years in prison for offending the king. Other countries have passed or are considering steep fines for cybercrimes that include insulting leaders or top officials on social media.

Kuwait, which long had a reputation for some of the region’s most vibrant politics and civic life, has distinguished itself over the last year by prosecuting dozens of people accused of insulting the country’s emir, Sheik Sabah al-Ahmad al-Sabah, according to human rights advocates. On Monday, Musallam el-Barrak, one of Kuwait’s most popular opposition politicians and a former member of Parliament, was sentenced to five years in prison for comments he made during a speech at a political rally in October.

The rally was one of several by antigovernment protesters angered at a proposal by the emir to amend the country’s election law. In a thundering speech, Mr. Barrak repeated a phrase that would become a slogan of the protest movement — “We will not allow you” — and warned the ruler about “practicing autocracy.”