As a boy Andrew was employed in the office of the county clerk, where he learned to read and commenced the study of law.
Moving to Texas in 1847, Andrew Hamilton established themselves on a farm near La Grange. In 1849 Hamilton, who was an excellent stump speaker, secured appointment as attorney-general of the state. He thereupon removed to Austin, where he continued to reside, identifying himself with the frontier needs and ideals of western Texas. He served a term in the state legislature, 1851-1853, as a representive of Travis County, and in 1859, as the result of the Unionist victory of that year which made Sam Houston governor, he was sent to Congress. There, although he was a new member, he received a substantial vote as a compromise candidate for speaker. Again and again, from his Western point of view, he spoke for conciliation, pointing out the economic grievances of the South and the measures by which he believed that the tide of secession might be checked. Even after the withdrawal of the other representatives of Texas, he remained in Congress, returning to Texas in March 1861, to be elected to the state legislature as an avowed Unionist, from one of the few districts in the state which even then commanded a majority against secession.
With the outbreak of war, Hamilton was regarded as a traitor to his state. A year later he escaped through Mexico to Washington, where he was promptly appointed by Lincoln and Stanton a brigadier-general and provisional governor of Texas. The remainder of the war he spent largely in New Orleans, waiting for a favorable opportunity to assume the functions of his office. In 1864 he obtained a permit from the President to export cotton from Texas. In spite of the disapproval of Welles, his appointment as provisional governor was confirmed by President Johnson, and he arrived in Galveston in June 1865, to carry out the difficult task of Presidential reconstruction.
Going to Washington as one of the leaders of a band known as the “Southern loyalists, ” he was soon, strangely enough, numbered with the opponents of President Johnson and of the policies which he represented, and in this capacity, opposed the recognition of Texas, perhaps because its officers were so largely ex-Confederates. His decisions as a member of the Texas supreme court, to which he had been appointed in 1866 by military authority, were also eminently conservative, tending as they did to validate all the ordinary acts of Texas during the period of secession. The most important cases in which he rendered a decision were the Sequestration Cases. He was counsel in the important case of Ex parte Rodrigues.
When the Congressional plan of reconstruction was introduced, including negro suffrage, Hamilton felt that the Northern Radicals had gone far enough, and in 1868 he regained much of his lost popularity by opposing the disfranchisement of the white voters, a measure of which his brother, Morgan Calvin Hamilton, later United States senator, was one of the chief advocates. The conservatives now turned to him as their candidate for governor. Hamilton always believed that he was legally elected, but his selection was set aside by the military authorities in favor of his more radical opponent, who inaugurated the brief but disastrous era of Carpet-bag domination. When the Democrats came into power in 1873, Hamilton was bitterly disappointed and sought to challenge the legality of the election before the courts, but the new administration was too firmly entrenched by Republican mistakes to fear judicial decrees, and it was evident that the career of even a conservative Republican in Texas was ended. His death occurred suddenly two years later.
In 1841 Hamilton was admitted to the bar, and two years later married Mary Jane Bowen.