diff --git a/src/TwigExtension.php b/src/TwigExtension.php
index 4cb623e..deb680e 100644
--- a/src/TwigExtension.php
+++ b/src/TwigExtension.php
@@ -13,6 +13,7 @@ use Drupal\Core\Field\FieldItemListInterface;
 use Drupal\Core\Link;
 use Drupal\Core\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\Render\Element;
+use Drupal\Core\Render\Markup;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\Url;
 use Drupal\image\Entity\ImageStyle;
@@ -535,6 +536,13 @@ class TwigExtension extends \Twig_Extension {
   public function drupalLink($text, $user_input, array $options = [], $check_access = FALSE) {
     $url = $this->drupalUrl($user_input, $options, $check_access);
     if ($url) {
+      // The text has been processed by twig already, convert it to a safe object
+      // for the render system.
+      // @see \Drupal\Core\Template\TwigExtension::getLink()
+      if ($text instanceof \Twig_Markup) {
+        $text = Markup::create($text);
+      }
+
       return Link::fromTextAndUrl($text, $url);
     }
   }
diff --git a/tests/src/Functional/TwigTweakTest.php b/tests/src/Functional/TwigTweakTest.php
index d16b35f..68316fb 100644
--- a/tests/src/Functional/TwigTweakTest.php
+++ b/tests/src/Functional/TwigTweakTest.php
@@ -6,6 +6,7 @@ use Drupal\Core\Link;
 use Drupal\Core\Url;
 use Drupal\file\Entity\File;
 use Drupal\responsive_image\Entity\ResponsiveImageStyle;
+use Drupal\Core\Render\Markup;
 use Drupal\Tests\BrowserTestBase;
 use Drupal\user\Entity\Role;
 
@@ -218,10 +219,18 @@ class TwigTweakTest extends BrowserTestBase {
 
     // Test link.
     $url = Url::fromUserInput('/node/1/edit', ['absolute' => TRUE]);
-    $link = Link::fromTextAndUrl('Edit', $url)->toString();
+    $link = Link::fromTextAndUrl('<b>Edit</b>', $url)->toString();
     $xpath = '//div[@class = "tt-link"]';
     self::assertEquals($link, trim($this->xpath($xpath)[0]->getHtml()));
 
+    // Test link with HTML.
+    $text = Markup::create('<b>Edit</b>');
+    $url = Url::fromUserInput('/node/1/edit', ['absolute' => TRUE]);
+    $link = Link::fromTextAndUrl($text, $url)->toString();
+    $xpath = '//div[@class = "tt-link-html"]';
+    self::assertEquals($link, trim($this->xpath($xpath)[0]->getHtml()));
+
+
     // Test status messages.
     $xpath = '//div[@class = "tt-messages"]/div[contains(@class, "messages--status") and contains(., "Hello world!")]';
     $this->assertByXpath($xpath);
diff --git a/tests/twig_tweak_test/templates/twig-tweak-test.html.twig b/tests/twig_tweak_test/templates/twig-tweak-test.html.twig
index ac6f42f..507d450 100644
--- a/tests/twig_tweak_test/templates/twig-tweak-test.html.twig
+++ b/tests/twig_tweak_test/templates/twig-tweak-test.html.twig
@@ -44,7 +44,9 @@
   <div class="tt-config">{{ drupal_config('user.settings', 'anonymous') }}</div>
   <div class="tt-title">{{ drupal_title() }}</div>
   <div class="tt-url">{{ drupal_url('node/1', {absolute: true}) }}</div>
-  <div class="tt-link">{{ drupal_link('Edit', 'node/1/edit', {absolute: true}) }}</div>
+  <div class="tt-link">{{ drupal_link('<b>Edit</b>', 'node/1/edit', {absolute: true}) }}</div>
+  {# @see https://www.drupal.org/forum/support/theme-development/2016-12-01/add-html-tags-in-twig-function-link-in-template-drupal-8#comment-12525536 #}
+  <div class="tt-link-html">{% set link_text %}<b>Edit</b>{% endset %}{{ drupal_link(link_text, 'node/1/edit', {absolute: true}) }}</div>
   <div class="tt-messages">{{ drupal_messages() }}</div>
   <div class="tt-breadcrumb">{{ drupal_breadcrumb() }}</div>
   <div class="tt-link-access">{{ drupal_link('Administration', 'admin', {absolute: true}, true) }}</div>
