The Islamabad High Court on Tuesday declared illegal the jail trial of former Prime Minister Imran Khan on charges of leaking state secrets.