KATHMANDU, Nepal - A Canadian man has been ordered to leave Nepal within two days after authorities said he posted messages on social media that could disturb social harmony.

Home Ministry official Yadav Koirala says 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 worked for a software company in Nepal for three years, was detained on Monday for questioning and spent the night in detention.

The government made the decision to expel him late Tuesday.

Koirala says Penner was released from detention and handed over to a local family friend on the condition that he leaves the country in two days.

Penner has criticized the new constitution adopted last September and the government's handling of violent ethnic protests.