The resignation brings Trudeau's nine years in power to an end