KATHMANDU, Nepal — A Canadian man in Nepal who writes frequently about political issues on social media was arrested on Monday afternoon after “posting a provocative message on Twitter aimed at spreading social discord,” according a Nepalese immigration official.

The man, Robert Penner, has been living in Nepal for at least two years. He was arrested at his office in the Lalitpur district by a team of police officers on the instructions of the Department of Immigration, according to Pitambar Adhikari, the district police chief. Mr. Penner was turned over to the immigration authorities, who have held him since then.

Mr. Penner has been prolific online, often weighing in on political controversies. After Nepal passed a new Constitution last year, he questioned a citizenship provision that was seen as discriminatory against women. In November, he responded to critics of a Human Rights Watch report about violations in southern Nepal.

More recently, he criticized the detention of Kanak Mani Dixit, a journalist who was arrested last month on suspicion of abusing his position as the chairman of a transportation cooperative.