 Gary was first elected to office as a state representative in 1860.He was elected to the South Carolina State Senate in 1876 from Edgefield, South Carolina, serving two terms.He fell out with Hampton after failing to get appointments to the US Senate in 1877 and 1879, and left politics in 1881 after finishing his second term.