diff --git a/lib/ipaddress/ipv6.rb b/lib/ipaddress/ipv6.rb
index 33d4d19f2afa9022ba9a850549fa905232cde677..88098bc6417e3d58d1ccac5668a6f5bfbe3a1706 100644
--- a/lib/ipaddress/ipv6.rb
+++ b/lib/ipaddress/ipv6.rb
@@ -252,6 +252,15 @@ module IPAddress;
     end
     alias_method :group, :[]
 
+    #
+    # Updated the octet specified at index
+    #
+    def []=(index, value)
+      @groups[index] = value
+      initialize("#{IN6FORMAT % @groups}/#{prefix}")
+    end
+    alias_method :group=, :[]=
+
     # 
     # Returns a Base16 number representing the IPv6 
     # address
diff --git a/test/ipaddress/ipv6_test.rb b/test/ipaddress/ipv6_test.rb
index f0932d773b0812ea635c175b7c4b9b220596108e..dcfb6016f6502b1268e71c0057689c952888bf76 100644
--- a/test/ipaddress/ipv6_test.rb
+++ b/test/ipaddress/ipv6_test.rb
@@ -292,6 +292,12 @@ class IPv6Test < Minitest::Test
     assert_equal @ip.to_s, @klass.parse_hex(@hex,64).to_s
   end
 
+  def test_group_updates
+    ip = @klass.new("2001:db8::8:800:200c:417a/64")
+    ip[2] = '1234'
+    assert_equal "2001:db8:4d2:0:8:800:200c:417a/64", ip.to_string
+  end
+
 end # class IPv6Test
 
 class IPv6UnspecifiedTest < Minitest::Test
@@ -416,5 +422,5 @@ class IPv6MappedTest < Minitest::Test
   def test_mapped?
     assert_equal true, @ip.mapped?
   end
-  
+
 end # class IPv6MappedTest