Is it a tax gain or loss for liquidated stocks from margin trading account?

I had a margin tradimg account where stocks were liquidated due to a margin call.  The transaction itself was a gain, but the full amount was used to cover the call.  Is this considered a capital gain or loss from Tax reporting perspective?