The arrest came during a by-election that was overshadowed by allegations of violence and attacks on journalists.