In 1852 he was elected one of two Conservative members of parliament for Liverpool. He served as Parliamentary Secretary to the Treasury in Lord Derby's protectionistgovernment from February 1852 to January 1853. In April 1853 he introduced the Public Houses (Scotland) Bill to the Commons.[4] The Bill, which was eventually enacted as the Licensing (Scotland) Act 1853 (16 & 17 Vict. c.67), forced the closure of pubs in Scotland on Sundays and at 10pm on weekdays. Because of his active involvement in promoting it, the legislation was popularly known as the "Forbes Mackenzie Act".[1]

In the meantime he had been forced out of parliament. The two defeated Liberal candidates at Liverpool had issued an election petition contesting the results. In the ensuing court proceedings the Conservative election agents were found to have been guilty of bribery and treating. On 21 June 1853 the election was declared void.[5]

Forbes MacKenzie made an attempt to re-enter parliament at Derby in 1857, but failed to be elected.[1] In 1859 he was made chairman of the Scottish Lunacy Commissioners.[1]