A Manhattan appeals court said New York City’s Department of Social Services may claw back more than $250,000 from a man who was shot during a home invasion and was awarded a $4.3 million settlement in a suit against his property manager.

A unanimous panel of the Appellate Division, First Department, ruled on Tuesday that the city may fully recover a Medicaid lien placed on the plaintiff, who is identified in court papers as D.J. and who the court said ignored a directive from the Department of Social Services to include it in settlement negotiations for his premises liability suit.

D.J. was rendered a paraplegic after getting shot during a robbery in his Bronx apartment.

D.J., who was 16 years old at the time, and his mother brought a premises liability suit against 636 Holding Co., which owned the apartment complex, for negligently failing to maintain safe conditions at the property.

D.J.’s family’s insurance coverage was eventually exhausted and Medicaid subsequently took up his medical expenses over a period of nine years.

In April 2010, the Department of Social Services filed a Medicaid lien to recover D.J.’s past medical expenses, which were more than $250,000.

The department told the plaintiffs that they are required to let it know if there are settlement talks taking place or face a subrogation action, but the plaintiffs did not inform the department that negotiations between them and the owners of the apartment complex were indeed underway.

The month after the department filed the lien, D.J. and the property owner reached a $4.3 million settlement. Attempts to resolve the lien fell through and, several months later, D.J. filed to vacate the lien entirely, arguing that the entire settlement was for pain and suffering and not for past medical expenses.

In 2015, Bronx County Supreme Court Justice Barry Salman—who has since left the bench—found for the department and said that attributing the full settlement to pain and suffering would unlawfully deprive the department with an ability to enforce the lien.

In D.J.s appeal from the decision, Justices John Sweeny Jr., Rosalyn Richter, Richard Andrias and Marcy Kahn affirmed Salman, finding that the lower court properly characterized D.J.’s attempt to attribute the settlement payout to pain and suffering as an effort to deprive the department of its lien.

“The court correctly upheld the recovery of money that the city was entitled to under the law,” said Law Department spokesman Nicholas Paolucci.

Laura Gentile of Gentile and Associates represented the plaintiff. In court papers, she argued that her client was under no obligation to tell the city about the pending settlement negotiations because that didn’t become a requirement until more than one year after the settlement was reached.

“It’s very disappointing a we’ll deal with it procedurally,” Gentile said of the court’s decision in an interview.