Treasury stock is a company's own stock that it has reacquired from shareholders. When a company buys back shares, the expenditure to repurchase the stock is recorded in a contra equity account. This is a balance sheet account that has a natural debit balance. Since this treasury stock account is classified within the equity section of the balance sheet (where all other accounts have a natural credit balance), this means that the account is considered a contra equity account. Thus, the effect of recording a treasury stock transaction is to reduce the total amount of equity recorded in a company's balance sheet.
The treasury stock line item is usually placed at or near the end of the line items within the equity section, but there is no official presentation guideline mandating that it must be placed in that position. Thus, there is no reason why the treasury stock line item cannot be positioned anywhere within the equity section of the balance sheet.