diff --git a/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java b/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
index 7a13736..ca273bc 100644
--- a/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
+++ b/shell/src/main/java/org/apache/felix/shell/impl/SystemPropertiesCommandImpl.java
@@ -29,6 +29,7 @@
  * Usage:
  * sysprop                 -> displays all the system properties
  * sysprop [key]           -> displays the [key] property 
+ * sysprop -r [key]        -> removes the [key] property
  * sysprop [key] [value]   -> set the property [key] to [value]
  */
 public class SystemPropertiesCommandImpl implements Command
@@ -45,17 +46,22 @@
         else
         {
             st.nextToken();
-            String propertyKey = st.nextToken();
+            String secondArgument = st.nextToken();
 
             if (tokens == 2)
             {
-                out.println(propertyKey + "=" + System.getProperty(propertyKey));
+                out.println(secondArgument + "=" + System.getProperty(secondArgument));
             }
-            else
+            else if (tokens == 3)
             {
-                String value = st.nextToken();
-                System.setProperty(propertyKey, value);
-                out.println("Set " + propertyKey + "=" + value);
+                if ("-r".equals(secondArgument))
+                    removeProperty(st.nextToken());
+                else
+                {
+                    String value = st.nextToken();
+                    System.setProperty(secondArgument, value);
+                    out.println("Set " + secondArgument + "=" + value);
+                }
             }
         }
     }
@@ -70,6 +76,11 @@
         }
     }
 
+    private void removeProperty(String key)
+    {
+        System.getProperties().remove(key);
+    }
+
     public String getName()
     {
         return "sysprop";
@@ -77,11 +88,11 @@
 
     public String getShortDescription()
     {
-        return "Display, set and modify system properties";
+        return "Display, set, modify and remove system properties";
     }
 
     public String getUsage()
     {
-        return "sysprop [<key>] [<value>]";
+        return "sysprop [-r] [<key>] [<value>]";
     }
 }
\ No newline at end of file
diff --git a/shell/src/test/java/org/apache/felix/shell/impl/SystemPropertiesTest.java b/shell/src/test/java/org/apache/felix/shell/impl/SystemPropertiesTest.java
new file mode 100644
index 0000000..aea0475
--- /dev/null
+++ b/shell/src/test/java/org/apache/felix/shell/impl/SystemPropertiesTest.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.shell.impl;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+
+import junit.framework.TestCase;
+
+public class SystemPropertiesTest extends TestCase
+{
+
+    SystemPropertiesCommandImpl sysprop = new SystemPropertiesCommandImpl();
+
+    public void testCanDisplayASingleProperty()
+    {
+        System.setProperty("first", "foo");
+        assertEquals("foo", System.getProperty("first"));
+
+        ByteArrayOutputStream bos = new ByteArrayOutputStream();
+        PrintStream ps = new PrintStream(bos);
+
+        sysprop.execute("sysprop first", ps, System.err);
+        assertTrue(bos.toString().startsWith("first=foo"));
+    }
+
+    public void testCanCreateProperty()
+    {
+        assertNull(System.getProperty("foo"));
+        sysprop.execute("sysprop foo bar", System.out, System.err);
+        assertEquals("bar", System.getProperty("foo"));
+    }
+
+    public void testCanChangePropertyValue()
+    {
+        System.setProperty("foo", "bar");
+        assertEquals("bar", System.getProperty("foo"));
+
+        sysprop.execute("sysprop foo barbar", System.out, System.err);
+
+        assertEquals("barbar", System.getProperty("foo"));
+    }
+
+    public void testCanRemoveProperty()
+    {
+        System.setProperty("foo", "bar");
+        assertEquals("bar", System.getProperty("foo"));
+        sysprop.execute("sysprop -r foo", System.out, System.err);
+
+        assertNull(System.getProperty("foo"));
+    }
+}
