The South Longford by-election of 1917 was held on 9 May 1917, but due to a recount the results were announced on 10 May. The by-election was held due to the death of the incumbent Irish Parliamentary MP, John Phillips. It was won by the Sinn Féin candidate Joseph McGuinness.
McGuinness was serving a prison term when he was elected to Westminster and among those who worked on his election campaign was Michael Collins. The election slogan for McGuinness at the time was "Put him in to get him out!"
It was narrowly won by Sinn Féin with a majority of 37 votes.
McGuinness subsequently sat for the Longford Constituenecy in the Dáil Éireann.