Born in Newport, Rhode Island, Tew joined the Rhode Island Home Guards in 1846. The following year he became captain of the Newport Artillery Company. When the Civil War began, he was commissioned a captain in the 4th Rhode Island Infantry and was soon promoted to lieutenant colonel. Tew fought at the Battle of Roanoke Island, the Battle of New Bern, and the Siege of Fort Macon. He prominently participated in the rescue of Massachusetts troops at Little Washington in North Carolina. In 1864, the 5th Rhode Island Infantry was reformed as a heavy artillery unit, and Tew was promoted to colonel.