KATHMANDU (Reuters) - A Canadian living and working in Nepal who criticized the government on social media has been ordered to leave the country within two days, a Nepali official said on Tuesday.

Robert Penner, a computer programmer working for CloudFactory, an outsourcing company, was arrested by police at his office on Monday and taken to the Department of Immigration for questioning.

Penner confirmed that he had been ordered to leave on his Twitter account.

He criticized the Nepal government on social media during unrest that followed the passing of Nepal’s constitution last year and he denounced the recent arrest and detention of Kanak Mani Dixit, a prominent journalist and civil rights activist.

“Robert Penner must leave Nepal voluntarily within two days,” Kedar Neupane, Director General of the Department of Immigration, told Reuters.

“If he fails to leave within this time frame, he will be considered as staying here illegally,” added Neupane. He said there was no provision for Penner to make an appeal.

The deportation order comes after government officials received numerous complaints about tweets and online writings that Penner had posted, said Neupane. He declined to elaborate on exactly who and how many had complained.

Lawyer Dipendra Jha, who is representing Penner, earlier said he had been informed that the Canadian would be released on Tuesday and his visa revoked.

The Canadian consulate in Kathmandu could not be reached for comment. The Canadian High Commission in the Indian capital New Delhi declined to comment.

(This version of the story corrects the name of the company to CloudFactory)