Nepal has ordered a Canadian man to leave the country, saying that messages he has posted on Twitter are threatening national unity.
Robert Penner, who works as a computer programmer, was arrested on Monday and after being freed was told to leave Nepal within two days.
He had criticised the government's handling of ethnic protests.
Some Nepalese people have defended him, with one calling him a "sensible man asking sensible questions".
The country's immigration chief said Mr Penner had "incited conflict" and violated his visa terms, under which he could be expelled from the country if he became involved in any activities against Nepal or its government.
Mr Penner's lawyer, Dipendra Jha, told Buzzfeed News this was the "first case" of "this kind of arbitrary detention and decision to deport a foreign national for engaging in a conversation about Nepal's politics".
Mr Penner, who speaks and writes Nepali, has lived in the country since 2012. He has been there under a working visa.
He has tweeted about various political matters, and publicly supported the Madhesi ethnic group, who say Nepal's controversial new constitution discriminates against them.
In one article, he wrote that leadership positions in the country were not as open to Madhesi people as to others, because many of them have parents from both India and Nepal.
He wrote: "Many Madhesis are children of cross-border marriages. For those with foreign fathers, citizenship by descent is not available."
Nepal's new constitution defines the majority Hindu nation as a secular republic divided into seven federal provinces.
But ethnic groups in southern Nepal want more territory and rights for ethnic federal states.
At least 45 people died in protests against the constitution in September 2015.
Many social media users were opposed to the government's action against Mr Penner.
But a few people supported the government.