He officially resigns as leader of the main opposition Congress party, ending weeks of speculation.