 He was also a member of the Dedham school committee.Ely was elected as a Republican to the Forty-ninth Congress (March 4, 1885 – March 3, 1887).He was an unsuccessful candidate for reelection in 1886 to the Fiftieth Congress and resumed the practice of law, and did serve as justice of the Municipal Court of Boston 1888-1914.