SÃO PAULO—Brazil’s former President Michel Temer has been arrested in the latest breakthrough in the Car Wash investigation, sending shock waves through Congress as the country struggles to move on from the five-year-long corruption scandal.

Federal police armed with machine guns surrounded Mr. Temer’s car as he left his home in São Paulo on Thursday morning, taking the 78-year-old into custody before flying him to be jailed in Rio de Janeiro.

Prosecutors...