diff --git a/contextual.module b/contextual.module
index aa8d87b..589a0eb 100644
--- a/contextual.module
+++ b/contextual.module
@@ -98,6 +98,9 @@ function contextual_set_links($name = NULL, $link = NULL, $link_id = NULL) {
  * @param array $links A collection of actions.
  */
 function contextual_prepare_links($links) {
+  $destination = drupal_get_destination();
+  $destination_array = explode('=', $destination);
+  $destination_array = array($destination_array[0] => urldecode($destination_array[1]));
 
   $return_links = array();
 
@@ -113,6 +116,24 @@ function contextual_prepare_links($links) {
     else {
       $return_links[$key] = $link;
     }
+    // Add the destination query string parameter to all contextual links,
+    // unless there is one already.
+    if (isset($return_links[$key])) {
+      if (isset($return_links[$key]['query'])) {
+        // If query is an array, add the non-encoded destination.
+        if (is_array($return_links[$key]['query'])) {
+          $return_links[$key]['query'] += $destination_array;
+        }
+        // Otherwise, add the destination, unless it exists already.
+        elseif (!strtr($return_links[$key]['query'], 'destination=')) {
+          $return_links[$key]['query'] .= '&' . $destination;
+        }
+      }
+      // There is no query yet, just add the destination.
+      else {
+        $return_links[$key]['query'] = $destination;
+      }
+    }
   }
 
   return $return_links;
