NATO says a heavily armed Taliban commander has been killed in a shootout at a mosque in eastern Afghanistan .