Can I offset reimbursement from a settlement of a civil law suit against the payments I made to my lawyer who handle the case?

I've settled in a civil law suit but the settlement payment is far less than the amount of money I have paid to the lawyer who handled my case.  I want to know if I can offset my legal fees against the settle reimbursement?  If not, am I able to write-off legal fees paid to my lawyer as a deductible?