Long term tax on intraday transactions

If I sell my long-term holdings and buy the same shares again later on the same day, will it be considered an intraday transaction, or will my original long-term holdings be treated as sold and the shares purchased again be considered a new investment?

For example, I bought shares in 2021 at ₹500 per share and in 2026 I sell them at ₹2,500 per share. I sell the shares in the morning and buy them back before 3:30 PM on the same trading day. In this case, will my original long-term holding period and cost be maintained and the transaction treated as intraday, or will the original shares be considered sold (triggering long-term capital gains) and the newly purchased shares be treated as a fresh holding?

it will be intraday, if you purchase them same day. and no ltcg will be attracted

and my original buy average for the long term shares will stay the same right…?

yes it will remain same

It will be intraday , even if you buyback the sold shares in after market hours, even if you buy it on a different exchange. Your holdings will remain unaffected.

But if you use 2 different demat accounts, it will not be intraday.