The 1879 Longford by-election was held on 5 April 1879. The by-election was held due to the resignation (Assistant Commissioner of Intermediate Education in Ireland) of the incumbent Home Rule MP, Myles William O'Reilly. It was won by Justin McCarthy, a member of the Home Rule party. He was unopposed.