In 1889, there was a military coup, and Pedro II had to leave the country. In 1889, Brazil became a republic. The only people who could vote were people who owned land. There were some uprisings in the 1920s because some people thought the government was unfairly helping coffee growers. Brazil joined the Allies during World War II.