You are a co applicant and co-borrower in that loan. Hence, the bank has the right to recover the loan amount from you if your friend does not pay the EMI.
The liability of co-borrower is equal and to the same extent as the borrower has in respect of loan. Therefore you cannot absolve yourself from that liability. However, you have the right to recover the amount from your friend which you have paid to the bank in discharge of loan.
You are also entitled to receive interest on the amount you paid to the bank on default of payment committed by your friend.