William Montgomery was born in London, England, and was baptised on 14 January 1821 as William John Alexander Montgomery. He was the son of Josias Montgomery, a saddler, and his wife, Eleanor Martin. When William was four his father was killed in a hunting accident. He was educated at the Royal Belfast Academical Institution. He went to sea at the age of 13, studied navigation and astronomy, and became a third mate. At the age of about 18, finding himself on a ship with a drunken captain and a first mate ignorant of navigation, he sailed the vessel from the Mediterranean to London. He was made a captain and later bought the ship.
Montgomery sailed to Melbourne, Australia, in 1851, sold his ship and joined the Victorian goldrush. With his winnings he bought a sheep station on the Darling Downs. Eventually ruined by a severe drought he removed to Christchurch, New Zealand, and set up as a timber and general merchant in 1860. Montgomery visited England in the early 1860s, and on 29 August 1865 he married Jane Todhunter at Willesden, Middlesex.
Montgomery entered politics as a member of the Heathcote Road Board in 1864. In July 1866 he was elected to the Canterbury Provincial Council for Heathcote, and was a member of the provincial Executive Council by the end of the year. He was provincial treasurer in 1868, briefly deputy superintendent in 1868 and leader of the Executive Council from 1874 to 1875.
In 1874 Montgomery was elected MHR for Akaroa and proved to be devoted to both his constituency and his province. He took credit for the opening of Akaroa High School in 1881 and the Little River railway in 1884, and worked for the extension of the railway to Akaroa. Along with James Macandrew of Otago, he firmly opposed the abolition of the provinces, and advocated a system of financial separation for the South Island. He was said to be 'the most consistent, the most unselfish, the most clear-headed and clean-handed of the party…supporting Sir George Grey' after 1877, but refused to accept the post of colonial treasurer because Grey would not undertake to leave Canterbury its land fund. He nevertheless supported Grey on other issues, and was returned unopposed for Akaroa in 1879.
On Grey's defeat in 1879 his supporters split into factions: Montgomery and Macandrew led a South Island group opposed to Grey. Montgomery's election as leader of the opposition on 24 June 1882 appeared to ease these divisions, but the opposition remained deeply divided by incompatible provincial claims, and Montgomery proved ineffective. According to John Hall, 'He seems never to be able to make up his mind what to do unless it is to do nothing and follow his followers.' In 1884 his leadership was eclipsed by the reappearance of Julius Vogel in association with Robert Stout.
In the first Stout–Vogel ministry of August 1884, Montgomery was colonial secretary and minister of education. This ministry, regarded as too much of a South Island combination, was quickly defeated. In order to facilitate the formation of the second Stout–Vogel ministry in September, Montgomery stood down to allow the inclusion of Auckland members, an act which earned Stout's gratitude.
Montgomery retired from politics in 1887, and travelled to Europe for an extended stay for health reasons. On his return to New Zealand in 1891 he bought the Wairewa run at Little River. John Ballance called him to the Legislative Council in October 1892, and following Ballance's death in 1893 he became virtually the elder statesman of the Liberal party. Richard Seddon appointed him to his cabinet in July 1893 as member of the Executive Council, without portfolio. Montgomery resigned this office on 7 November 1895. He also briefly acted as leader of the Legislative Council, resigning from that body in 1907.
Montgomery played a leading role in the development of New Zealand's public education system. He was a member of the Canterbury Board of Education from 1867 to 1875 and chairman from 1867, and a member of the North Canterbury Education Board from 1878 to 1887 and 1891 to 1897. He helped to develop the Canterbury system of education which became the forerunner of the colonial system established under the Education Act 1877. As a member of the board of governors of Canterbury College from 1873 to 1903 and chairman from 1875 to 1885 he was primarily responsible for the completion of college buildings, the museum, Christchurch Boys' High School and the School of Art.
William Montgomery was widely respected for his integrity and industry, but was too ponderous and indecisive to achieve lasting political leadership. He died at Little River on 21 December 1914, in his early 90s. His wife, Jane, had predeceased him in 1879, and he was survived by two sons.