Yes. You will have to pay the capital gain tax on the sale of property. Repayment of Loan will not be eligible for the capital gain exemption.
To save, the best option is to invest in Capital Gain Bonds (REC. etc.) with a lock in period of 3 years. This should be done within 6 months from the date of sale.