Leonard was appointed as the district attorney of the thirteenth judicial district of Louisiana in 1871 and 1872. He was elected associate justice of the Louisiana Supreme Court in 1876 before he resumed the practice of law in Monroe, Louisiana.
In 1876 he was elected as a Republican to the Forty-fifth Congress, serving from March 4, 1877, until his death the following year in Havana, Cuba. He was vacationing with several other Washington leaders and died on March 15, 1878. He was buried in the Friends’ (Hicksite) Cemetery of the Middletown Meeting House, Middletown Township, Delaware County, Pennsylvania.