diff --git a/src/Plugin/Condition/BlockCountry.php b/src/Plugin/Condition/BlockCountry.php
index 43d1d30..e323281 100644
--- a/src/Plugin/Condition/BlockCountry.php
+++ b/src/Plugin/Condition/BlockCountry.php
@@ -9,6 +9,7 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\RequestStack;
 use Drupal\Core\Cache\Cache;
+use Drupal\ip2country\Ip2CountryLookup;
 
 /**
  * Provides a 'Country' condition.
@@ -34,6 +35,13 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
    */
   protected $requestStack;
 
+  /**
+   * IP2Country Lookup.
+   *
+   * @var \Drupal\ip2country\Ip2CountryLookup
+   */
+  protected $ip2CountryLookUp;
+
   /**
    * Creates a new BlockCountry instance.
    *
@@ -41,6 +49,8 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
    *   The country manager.
    * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
    *   The request stack.
+   * @param \Drupal\ip2country\Ip2CountryLookup $ip2_country_lookup
+   *  The IP2Country Lookup service.
    * @param array $configuration
    *   The plugin configuration.
    * @param string $plugin_id
@@ -48,10 +58,11 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
    * @param mixed $plugin_definition
    *   The plugin implementation definition.
    */
-  public function __construct(CountryManagerInterface $country_manager, RequestStack $request_stack, array $configuration, $plugin_id, $plugin_definition) {
+  public function __construct(CountryManagerInterface $country_manager, RequestStack $request_stack, Ip2CountryLookup $ip2_country_lookup, array $configuration, $plugin_id, $plugin_definition) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->countryManager = $country_manager;
     $this->requestStack = $request_stack;
+    $this->ip2CountryLookUp = $ip2_country_lookup;
   }
 
   /**
@@ -61,6 +72,7 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
     return new static(
       $container->get('country_manager'),
       $container->get('request_stack'),
+      $container->get('ip2country.lookup'),
       $configuration,
       $plugin_id,
       $plugin_definition
@@ -103,7 +115,7 @@ class BlockCountry extends ConditionPluginBase implements ContainerFactoryPlugin
     } else {
       $ip = $this->requestStack->getCurrentRequest()->getClientIp();
       $ret = true;
-      if ($country = ip2country_get_country($ip)) {
+      if ($country = $this->ip2CountryLookUp->getCountry($ip)) {
         if (!in_array($country, $this->configuration['country_list']))  {
           $ret = false;
         }
