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?

Investors and rental owners

The gain/loss would be based on the stock transaction, not the amount that the brokerage took after. However, you can deduct any margin interest charged as an expense.