It happened in Fahan, County Donegal, at around 21:00 local time on Sunday.
The men, whose faces were covered with scarves, struck the man on the head before escaping with a quantity of cigarettes.
The victim was taken to hospital with non life-threatening injuries.
Fine Gael councillor John Ryan said the local community was in shock.
"He (the victim) was closing up last night and I believe these guys arrived on the scene and attacked him," he said.
"At the end of the day, they got away with a small amount of cigarettes but people suffer after these types of incidents and it's just not acceptable," he added.
GardaÃ­ have appealed for information.
A shop owner has been injured after three men armed with batons robbed his filling station in the Republic of Ireland, Irish police (GardaÃ­) have said.