MANILA — Millions of Filipinos voted Monday to choose half of the nation’s Senate in what was widely seen as a proxy battle between President Rodrigo Duterte and politicians opposed to his deadly war on drugs.

Throughout the day, the police reported scattered incidents of violence and voter intimidation, including a shooting that injured five people at one voting area, as well as bombings believed to be connected to the elections.

Nearly 300,000 police officers and members of the armed forces were deployed nationwide to prevent violence, with the national police reporting that at least 20 people had been killed and 24 injured in election-related attacks in the weeks leading up to the voting.

Up for grabs are 12 Senate seats, nearly 300 seats in the House of Representatives and thousands of local posts, including mayor and governor positions, according to the Commission on Elections. But the spotlight was on the races for the Senate, where a tiny minority has been successful in blocking Mr. Duterte’s legislative agenda. Results are expected to be released in a few days.