MANDALAY, Myanmar—Buddhism is normally associated with meditation and withdrawing from the material world. But some monks here are playing a more temporal role, pressing a hard-line nationalist agenda ahead of next month’s elections that threatens the country’s nascent shift to democracy after decades of military rule.

Ashin Wirathu, the 47-year-old abbot of the Ma Soe Yein monastery in Mandalay, is among the most influential. His head shaved smooth, he frequently tugs a pair of battered reading glasses from the folds of his orange robes to check his buzzing cellphone or read notes passed to him by bowing aides. He is quick to smile and chats companionably with visitors.

He also has a long track record of advocating a hard-line, Buddhism-infused nationalism that mines a deep seam of anti-Muslim sentiment in Myanmar, much of it directed against ethnic Rohingya.

Ashin Wirathu at a Sept. 21 celebration in Mandalay of the Ma Ba Tha group he helped found ‘for the protection of race and religion.’PHOTO: AGENCE FRANCE-PRESSE/GETTY IMAGES

He was sentenced to 25 years in prison in 2003 for inciting attacks on Muslims. After his release in 2010 as a part of a broader amnesty, Mr. Wirathu has used social media and a network of DVD distributors to broadcast his sermons nationwide.

In an interview, he denied urging attacks on Muslims. He has, however, appeared at the scenes of some of the worst violence, usually visiting a monastery or delivering a sermon.

“They buy land and properties everywhere. They use the power of money to attract to women,” he said in a sermon before anti-Muslim riots in Meiktila in central Myanmar in 2013. He also habitually refers to Muslims as “kalar,” a derogatory term.

Mr. Wirathu helped create the Association for the Protection of Race and Religion, which this year persuaded parliament to enact laws restricting conversions and interfaith marriages—measures the group says are designed to stop the spread of Islam in a country that is about 90% Buddhist.

The group, known by its local acronym Ma Ba Tha, now focuses on providing legal help to Buddhists caught up in legal disputes with followers of other faiths and providing education and welfare services.

On Oct. 4, thousands of monks and their supporters rallied at a sports arena in the main city, Yangon, to celebrate their gains. “We’ve achieved a lot in a short time,” Mr. Wirathu said in the interview at his monastery.

He isn’t finished yet. After lunch, the abbot retreated from the 100-degree heat to rehearse video clips to be uploaded to YouTube, to help supporters decide whom to vote for on Nov. 8. It doesn’t matter which party the candidate represents, Mr. Wirathu said in front of a three-man camera team. What matters, he said, is if they are “the right kind of people.”

“We’ll be watching them to make sure they do what they say,” said Mr. Wirathu, who, like other Buddhist monks, is prohibited from voting.

The election pits the party of President Thein Sein, a former general, against opposition leader Aung San Suu Kyi’s National League for Democracy, with a host of smaller parties also competing.

Whoever wins, the nationalist monks argue that Buddhism should be placed front and center in the new-look Myanmar and fill the vacuum left by the old military order since it formally ceded power five years ago—even if that means sidelining minorities.

Buddhism has acquired a political edge in other parts of Asia as well.

Monks in Sri Lanka made a push into political life after the end of a decadeslong civil war. In Thailand, monks have played a prominent role in the mass street protests that helped lead to two military coups in the past decade.

Myanmar’s monks played a significant role in the campaign for independence from Britain and led antigovernment revolts in 1988 and 2007.

They appear to be having an impact.

President Thein Sein, in campaign videos for the Union Solidarity and Development Party, touts the passage of pro-Buddhist laws as a high point of his administration.

In a recent campaign speech, Ms. Suu Kyi had to deflect suggestions from the audience that she would turn Myanmar into a Muslim nation if her party were to form the next government. “Using this issue to campaign isn’t in line with the law and is twisting the political campaign,” she said. “People should not be worried about this.”

Her party has complained to Myanmar’s election commission about what is says is the monks’ intervention in the campaign, but says the commission hasn’t responded. The commission says it oversees only registered political parties, not lobby groups.

Win Htein, an executive with her party, said it chose not to have any Muslim candidates because that would have provided opponents with easy ammunition.

Some prominent voices have expressed concern about the nationalist creed promulgated by Mr. Wirathu and his supporters.

Tom Malinowski, the U.S. assistant secretary of state for democracy, human rights and labor, said that “clearly there are forces that remain opposed to the democratic transition” who are “using race and religion to change the subject of the election.”

A founding member of Ms. Suu Kyi’s party, 88-year-old Tin Oo, visited Mr. Wirathu in Mandalay on Sept. 30 in an effort to ease tensions. After the octogenarian prostrated himself before the monk in a customary gesture of respect, Mr. Wirathu said in a video uploaded to his Facebook page that Ma Ba Tha would ease off its attacks—if the party distanced itself from criticism of the nationalists.