 After only a year in Parliament he was elected to serve as Speaker of the House of Commons in the Habeas Corpus Parliament, as a compromise between Parliament, who wished to reelect Sir Edward Seymour and the King, who was averse to him.During his time in Parliament Gregory was instrumental in the passing of the Habeas Corpus Act 1679, and was subsequently knighted and then confirmed as Baron of the Exchequer.In 1689 he was appointed Chief Justice of the King's Bench, a position he held until his death.