Complex sentence: The election itself was plagued by corruption and denounced by both sides, and when it had become clear that the Sao Paulo candidate, Julio Prestes, had won the election, the military decided to initiate a bloodless coup.
Split into simpler sentences: The election itself was plagued by corruption and denounced by both sides. However, when it had become clear that the Sao Paulo candidate, Julio Prestes, had won the election, the military decided to initiate a bloodless coup.