The judge said that a medical report showed that constables Dennis Nambisia and Agapio Ndwiga were badly injured during the attack.
The MP is likely to lose his seat for missing eight consecutive parliamentary sessions.
A Kenyan court on Thursday sentenced a member of parliament to four years in prison or a fine of Ksh1 million ($10,000) for assault.
Omar Mwinyi, MP for coastal Changamwe Constituency, was found guilty of assaulting two police officers during the opposition Orange Democratic Movement (ODM) party nominations in April last year.
The judge said that a medical report showed that constables Dennis Nambisia and Agapio Ndwiga were badly injured during the attack.
"Having carefully considered the evidence by the prosecution, I find the accused guilty as charged," the judge ruled.
"It is clear the accused failed to restrain or stop his supporters from disrupting the polls therefore he is deemed to have participated in the fracas," he said.
The two officers assaulted were providing security to voters and Independent Electoral and Boundaries Commission (IEBC) officials.
Mr Mwinyi was accused jointly with others not before the court of destroying ODM ballot boxes in four polling stations on April 22, 2017.
The court dropped seven other charges such as interfering with election materials, obstructing election officers and using violence during the primaries.
The MP is likely to lose his seat for missing eight consecutive parliamentary sessions.