The incident occurred on Wednesday evening in Sierre when a youth in a car driven by a friend used an “airsoft” gun to fire on party members assembled outside a restaurant for a meeting, Valais cantonal police said.
Four people were injured by the plastic bullets, some in the face and one in the hand, police said.
Working with Sierre municipal police, officers from the cantonal force tracked down the culprit along with the driver of the vehicle.
The suspects, aged 16 and 18, acknowledged having fired on the politicians but said their targets were chosen at random and they were not aimed at the Liberal party, police said.
Subsequent investigations revealed that other people had been fired on previously in Sierre and in the city of Sion.
Moving vehicles received window damage, glass was shattered at several bus shelters and traffic lights were targeted by bullets fired from the replica guns.
The youths also admitted to shooting at a dog in Sierre, police said.
Officers seized six replica pistols and a replica machine gun using plastic bullets five millimetres in diameter.
After being detained for questioning and to allow for searches, the pair have been released but both face charges.
The 18-year-old has been referred to Valais justice authorities, while the 16-year-old faces a hearing before the youth court.
Police are seeking information from other people who may have been shot.
Although airsoft guns are used mostly for recreational purposes and are designed to be non-lethal, they have been regulated like regular firearms in Switzerland since 2008.
It is illegal for people under the age of 18 to possess them and threatening people with a replica gun is also a criminal offence.