The gunmen reportedly reached the venue of the rally in Bloemendhal area in two vehicles and sprayed bullets into the crowd of around 500 to 600 people campaigning for Finance Minister Ravi Karunanayake of the United National Party (UNP).
The attack took place soon after Karunanayake left the venue.
One woman was killed while 13 others were injured in the attack, the first major incident of violence ahead of the polls to elect a 225-member parliament for a five-year term.
"I was seconds away - or about 20 feet from the incident.
Also Read
"This is nothing but an act of political terrorism sponsored by the opposition led by Rajapaksa," the 52-year-old minister, one of UNP's most senior members, told reporters here.
"While the crackers were going off the four masked men got off a black coloured car and opened fire," he said, adding: "People realised what had happened when several people started falling and were bleeding."
Sri Lanka elections have been marked with increased number of violent incidents since late 1990s.
The August election is to be monitored by European Union poll monitors. A team of observers from EU nations have already been deployed in all 22 electoral districts.