MOSCOW — A Russian court on Saturday rejected an appeal by the opposition leader Aleksei A. Navalny, clearing the way for his possible transfer to the country’s penal colony system.

The ruling was expected. Russian officials had signaled since before Mr. Navalny returned from Germany, where he was being treated for a near-lethal poisoning with a nerve agent last year, that his homecoming would land him in a prison.

Under Russia’s criminal justice system, transferring an inmate to the penal colonies is a lengthy process of travel on a specialized prisoner train wagon. It can begin at any point after a court rejects the first appeal of a sentencing, which happened on Saturday.

The trip can take weeks, with stops at transfer prisons, during which inmates are generally not allowed to contact lawyers or family members. Their destination sometimes remains unknown until they arrive.

The ruling was the last possible appeal before his potential transfer to a penal colony, but it remains unclear when Mr. Navalny would depart from Moscow. He could be held in a high-security prison in the capital to appear in court for other pending legal matters.

The ruling upheld Mr. Navalny’s sentence of more than two years in prison and set Russia on a collision course with Western nations, which could impose additional sanctions on Moscow. The European Court of Human Rights has demanded that Russia release Mr. Navalny.

He is Russia’s highest-profile prisoner since the incarceration a decade ago of the former oil magnate Mikhail B. Khodorkovsky, also in a politically hued case.

Andrew E. Kramer contributed reporting.