John Flickner, 78, held his medical marijuana vaporizer Friday. He’s staying at a homeless shelter after being evicted for using medical marijuana inside his federal subsidized apartment. Carolyn Thompson/Associated Press

NIAGARA FALLS, N.Y. — A 78-year-old man who relies on medical marijuana for back pain finds himself homeless after being evicted from federally subsidized housing in a case complicated by conflicting state and federal marijuana rules.

John Flickner was staying at a Niagara Falls shelter Thursday, after an hourslong eviction ordeal Tuesday that ended with him steering his electric wheelchair in freezing temperatures to a center about a half mile away.

‘‘Cold, wet, windy,’’ Flickner recalled of the trip, which was photographed by The Buffalo News.

‘‘All I wanted to do was get out of the wind,’’ Flickner said Thursday inside Community Missions, the facility he transferred to the next day.

Niagara Towers, where Flickner lived for two years, is subsidized by the federal Department of Housing and Urban Development. Although New York state has legalized medical marijuana, HUD says it gives landlords discretion on whether to evict residents for using it. Marijuana use remains illegal under federal law.

Flickner’s problems with his landlord started in June, when inspectors found marijuana in his apartment and called police. Responding officers declined to charge Flickner — who said he got the marijuana from a doctor in Canada — but advised him that he needed a prescription to possess it.

Flickner said he had no trouble quickly getting a doctor’s prescription and had it long before this week’s eviction.

‘‘I didn’t know about getting the card. I just knew it was legal,’’ he said. ‘‘I wasn’t hiding anything.’’

Still, the Tennessee company that owns the complex, LHP Capital, moved forward with ending his lease.

‘‘The basis of the eviction was they have a zero-tolerance (policy) and he had marijuana in his apartment and at that time he did not have medical marijuana,’’ said Niagara Falls attorney Jason Cafarella, who represented LHP at a November hearing in Niagara Falls City Court. ‘‘It was a lease violation and the tenant had known what the rules of the property were, had known the rules of the lease and violated those rules.’’

A judge issued a Nov. 29 eviction order.

‘‘What really swayed the judge, the be-all, end-all factor, was a regulation which basically gives management the ability to impose this zero-tolerance rule regardless of medical marijuana or otherwise,’’ said attorney Kevin Quinn of the Center for Elder Law and Justice, who represented Flickner. ‘‘If it’s being used, they have that ability to terminate a lease.’’

It’s not unusual for people to be evicted from federally subsidized housing for medical marijuana use, though few are as old as Flickner, said David Mangone of Americans for Safe Access, a medical marijuana advocacy group.

‘‘It’s really a clear evidence of discrimination, and medical marijuana should be treated like any other medication when it comes to living in subsidized housing,’’ said Mangone, the Washington-based group’s director of government affairs.

HUD responded to a request for comment by forwarding the agency’s 2014 guidance giving landlords discretion on whether to evict current residents for the use medical marijuana. The memo said landlords are supposed to deny new applicants for subsidized housing if they use medical marijuana.

There was no immediate comment from HUD specifically on Flickner’s eviction.

LHP did not respond to two telephone messages seeking comment. The company has 55 properties in eight states, according to its website.

Flickner on Thursday was waiting for a friend to help him make arrangements for a new place to live.

In the meantime, Community Missions spokesman Christian Hoffman said the facility wouldn’t stop him from using the odorless, pen-like vaporizer that delivers his medicine. Flickner, a former tool-and-dye worker, said he injured his back in a skydiving mishap 50 years ago. Medical marijuana relaxes his muscles better and more safely, he said, than addictive opioids.

‘‘We’re going along with state guidelines,’’ Hoffman said.

Although Flickner is the first client to arrive at the shelter under these circumstances, Hoffman said he wouldn’t be surprised if others followed.