diff --git a/src/java.desktop/share/classes/javax/swing/ImageIcon.java b/src/java.desktop/share/classes/javax/swing/ImageIcon.java
index 860235fefd..371a36d316 100644
--- a/src/java.desktop/share/classes/javax/swing/ImageIcon.java
+++ b/src/java.desktop/share/classes/javax/swing/ImageIcon.java
@@ -24,24 +24,28 @@
  */
 package javax.swing;
 
+import sun.awt.AWTAccessor;
+import sun.awt.AppContext;
+
+import javax.accessibility.*;
 import java.awt.*;
-import java.awt.image.*;
-import java.beans.ConstructorProperties;
+import java.awt.image.ColorModel;
+import java.awt.image.ImageObserver;
+import java.awt.image.MemoryImageSource;
+import java.awt.image.PixelGrabber;
 import java.beans.BeanProperty;
+import java.beans.ConstructorProperties;
 import java.beans.Transient;
-import java.net.URL;
-
-import java.io.Serializable;
-import java.io.ObjectOutputStream;
-import java.io.ObjectInputStream;
 import java.io.IOException;
-
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.net.URL;
+import java.security.AccessControlContext;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
 import java.util.Locale;
-import javax.accessibility.*;
-
-import sun.awt.AppContext;
-import java.security.*;
-import sun.awt.AWTAccessor;
 
 /**
  * An implementation of the Icon interface that paints Icons
@@ -306,17 +310,32 @@ public class ImageIcon implements Icon, Serializable, Accessible {
      */
     protected void loadImage(Image image) {
         MediaTracker mTracker = getTracker();
-        synchronized(mTracker) {
+        synchronized (mTracker) {
             int id = getNextID();
+            boolean wasInterrupted = false;
 
-            mTracker.addImage(image, id);
             try {
+                loadStatus = 0;
+                mTracker.addImage(image, id);
                 mTracker.waitForID(id, 0);
-            } catch (InterruptedException e) {
-                System.out.println("INTERRUPTED while loading Image");
+
+            } catch (InterruptedException e1) {
+                wasInterrupted = true;
+                try {
+                    mTracker.waitForID(id, 0);
+                } catch (InterruptedException e2) {
+                    loadStatus = MediaTracker.ABORTED;
+                }
+            } finally {
+                if (loadStatus == 0) {
+                    loadStatus = mTracker.statusID(id, false);
+                }
+                mTracker.removeImage(image, id);
+
+                if (wasInterrupted) {
+                    Thread.currentThread().interrupt();
+                }
             }
-            loadStatus = mTracker.statusID(id, false);
-            mTracker.removeImage(image, id);
 
             width = image.getWidth(imageObserver);
             height = image.getHeight(imageObserver);
diff --git a/test/jdk/javax/swing/imageIconInterrupted.java b/test/jdk/javax/swing/imageIconInterrupted.java
new file mode 100644
index 0000000000..fc088b5f95
--- /dev/null
+++ b/test/jdk/javax/swing/imageIconInterrupted.java
@@ -0,0 +1,45 @@
+import javax.swing.*;
+import java.awt.*;
+import java.net.URL;
+
+/*
+ * @test
+ * @bug JDK-123456
+ * @summary the test tries to load a gif-icon under different circumstances. When the GIF is valid, the image load
+ *          status is COMPLETE. When the image doesn't exist - ERRORED. When the image load is interrupted, we try to
+ *          reload it again.
+ * @run main/othervm imageIconInterrupted
+ */
+
+public class imageIconInterrupted {
+    static byte[] EMPTY_GIF = new byte[]{
+            (byte) 0x47, (byte) 0x49, (byte) 0x46, (byte) 0x38, (byte) 0x39, (byte) 0x61, (byte) 0x01, (byte) 0x00,
+            (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x21, (byte) 0xF9, (byte) 0x04,
+            (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x2C, (byte) 0x00, (byte) 0x00,
+            (byte) 0x00, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x01, (byte) 0x00, (byte) 0x00, (byte) 0x02
+    };
+
+    public static void main(String[] args) throws Exception {
+        Toolkit ignoreToolkit = Toolkit.getDefaultToolkit();
+
+        ImageIcon iconGif = new ImageIcon(EMPTY_GIF);
+        if (iconGif.getImageLoadStatus() != MediaTracker.COMPLETE) {
+            throw new RuntimeException("Couldn't load GIF from bytes");
+        }
+
+        ImageIcon iconNotExist = new ImageIcon(new URL("http://doesnt.exist.anywhere/1.gif"));
+        if (iconNotExist.getImageLoadStatus() != MediaTracker.ERRORED) {
+            throw new RuntimeException("Got unexpected status from non-existing GIF");
+        }
+
+        Thread.currentThread().interrupt();
+        ImageIcon iconInterrupt = new ImageIcon(EMPTY_GIF);
+        if (iconInterrupt.getImageLoadStatus() != MediaTracker.COMPLETE) {
+            throw new RuntimeException("Couldn't load GIF from bytes after interruption");
+        }
+
+        if (!Thread.currentThread().isInterrupted()) {
+            throw new RuntimeException("Interrupt was swallowed");
+        }
+    }
+}
