401k about paying a spouse

If i was court ordered to  pay half my 401k to my ex-spouse in a divorce settlement am I liable for the taxes or are they? also is there a deduction i qualify for?