You only pay the interest being charged on the loan, not any of the capital that you have borrowed.
​
If you carried on paying a mortgage on an interest only basis for the whole mortgage term you would still owe the full amount you had borrowed at the end of the term.