diff --git a/config/install/registration_role.setting.yml b/config/install/registration_role.setting.yml
index bd295eb..1d8e9d7 100644
--- a/config/install/registration_role.setting.yml
+++ b/config/install/registration_role.setting.yml
@@ -1 +1,2 @@
 role_to_select: { }
+registration_mode: 'user'
diff --git a/registration_role.module b/registration_role.module
index 2be373d..dee209a 100644
--- a/registration_role.module
+++ b/registration_role.module
@@ -24,7 +24,27 @@ function registration_role_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_ENTITY_TYPE_presave() for user entities.
  */
 function registration_role_user_presave(UserInterface $user) {
-  if ($user->isNew()) {
+  $config = \Drupal::config('registration_role.setting');
+  $case = $config->get('registration_mode');
+
+  // Do not assign the roles by default.
+  $assign_roles = FALSE;
+
+  // Get the current user id.
+  $current_user_id = \Drupal::currentUser()->id();
+  if ($current_user_id == 0) {
+    // If the current user id is 0, then this user is self registrating, so ask
+    // the module to assign roles, if applicable.
+    $assign_roles = TRUE;
+  }
+  elseif ($current_user_id != 0 && $case == 'admin') {
+    // If the current user id is not 0, then another user (admin, or anyone with
+    // the right permission) is creating this user, so the module will be asked
+    // to assign roles only if the setting is set to 'admin'.
+    $assign_roles = TRUE;
+  }
+
+  if ($user->isNew() && $assign_roles) {
     $config = \Drupal::config('registration_role.setting');
 
     foreach ($config->get('role_to_select') as $key => $value) {
diff --git a/src/Form/RegistrationRoleSettings.php b/src/Form/RegistrationRoleSettings.php
index e2c96bb..daaf775 100644
--- a/src/Form/RegistrationRoleSettings.php
+++ b/src/Form/RegistrationRoleSettings.php
@@ -53,6 +53,20 @@ class RegistrationRoleSettings extends ConfigFormBase {
       '#default_value' => $case,
       '#description' => 'The selected role will be assigned to users who register using the user-registration form. Be sure this role does not have any privileges you fear giving out without reviewing who receives it.',
     );
+
+    $mode_case = $config->get('registration_mode');
+    $registration_mode_options = [
+      'user' => t('User self registration'),
+      'admin' => t('Both user self registration and user creation by admin'),
+    ];
+    $form['registration_mode'] = array(
+      '#type' => 'radios',
+      '#title' => t('Registration mode'),
+      '#required' => TRUE,
+      '#options' => $registration_mode_options,
+      '#default_value' => $mode_case ? $mode_case : 'user',
+      '#description' => 'Select if the role will be assigned only on the user self registration form, or also when an administrator is creating that user.',
+    );
     return parent::buildForm($form, $form_state);
   }
 
@@ -65,6 +79,11 @@ class RegistrationRoleSettings extends ConfigFormBase {
       ->set('role_to_select', $saved_role)
       ->save();
 
+    $saved_mode = $form_state->getValue('registration_mode');
+    $this->config('registration_role.setting')
+      ->set('registration_mode', $saved_mode)
+      ->save();
+
     parent::submitForm($form, $form_state);
   }
 
