The attackers stormed a clinic in a remote part of Badghis province, more than 370km northwest of Kabul, late on Sunday and killed all five people inside.
According to the provincial governor, Hanayatullah Hanayat, a doctor and several nurses were among the dead and the gunmen then set the building alight after the shooting.
No patients were in the clinic at the time and security forces are investigating, Hanayat said.
The area is not a known Taliban stronghold but attacks have been taking place almost daily through the south and east of Afghanistan.
In other incidents, an explosion on Monday killed two policemen and wounded two others during an opium eradication patrol in the southern province of Helmand.
It was unclear whether the explosion was caused by a roadside bomb or a land mine.
Elsewhere in Helmand, Taliban militants stopped two Afghan trucks transporting food for coalition forces and killed one driver, while the other fled in his vehicle, according to a local district police chief.
At a press conference in Kabul, the US military said resurgent remnants of the toppled Taliban regime were becoming "very hard to combat" by using suicide and roadside bombings to spread fear across Afghanistan.
"They have shifted their tactics to something that is successful," said a spokesman, Colonel James Yonts.
The Taliban have regularly attacked aid workers and road construction crews, saying their work is supporting the government and foreign forces. About 30 aid workers were killed last year.
A recent surge in suicide bombings and other violence followed a Taliban announcement that they had launched a spring offensive, and comes as Nato members are preparing to send thousands more peacekeepers.
Britain, Canada and the Netherlands are leading a Nato expansion into the dangerous south of the country as the US hopes to cut its Afghan force by several thousand to about 16,500.
Critics in some Nato countries say the troops risk getting entangled in a relentless insurgency that is partly fuelled by the drugs trade.
Most Afghans say they want foreign troops to stay until their army and police can ensure security.