SAN FRANCISCO — The City of Oakland has filed a lawsuit in federal court to prevent the Department of Justice from seizing property leased to the largest medical marijuana dispensary in the country.

“This lawsuit is about protecting the rights of legitimate medical patients,” City Attorney Barbara Parker said in a statement on Wednesday, when the suit was filed. “I am deeply dismayed that the federal government would seek to deny these rights and deprive thousands of seriously ill Californians of access to safe, affordable and effective medicine.”

The civil lawsuit, which the City Council approved, seeks to “restrain and declare unlawful” the forfeiture proceedings against the landlords of the dispensary, Harborside Health Center, stating that Oakland will “suffer irreparable harm if the dispensaries are shuttered.”

“It is heartening to see the city stand up and support us,” said Steve DeAngelo, Harborside’s executive director. At its Oakland location, the nonprofit dispensary employs 100 people and serves some 112,000 more, seeing 600 to 800 customers a day. Last year, the group paid $3.5 million in taxes, including $1.1 million to the city.