When Minnesota achieved statehood in 1858 McMillan was named as the first judge of the newly formed Minnesota District Court. During the Dakota War of 1862 McMillan served as a Second Lieutenant in a militia unit known as the Stillwater Frontier Guards which was only briefly active. In 1864 he was appointed to the Minnesota Supreme Court as one of two new justices to replace the recently resigned Justices Charles Eugene Flandrau and Isaac Atwater. In 1874 he was promoted to Chief Justice to replace Christopher G. Ripley who had also resigned. In 1875, the Minnesota Legislature elected him to serve as U.S. Senator. He served in the 44th, 45th, 46th, 47th, 48th, and 49th United States Congresses from March 4, 1875, to March 4, 1887.