Nepalese officials say they have ordered a Canadian man to leave the country within two days for posting messages on social media that could disturb social harmony.

Home Ministry official Yadav Koirala said Robert Penner's work visa was revoked because a report prepared by authorities suggested his critical posts on Twitter threatened national unity.

Penner, who has been working for a software company, was detained on Monday for questioning. He has criticized the new constitution adopted last year and the government's handling of violent ethnic protests.

Penner could not be reached for comment. His lawyer said he had no information about the case.