diff --git a/includes/commerce_shipping.checkout_pane.inc b/includes/commerce_shipping.checkout_pane.inc
index fed4752..40f371e 100644
--- a/includes/commerce_shipping.checkout_pane.inc
+++ b/includes/commerce_shipping.checkout_pane.inc
@@ -131,6 +131,29 @@ function commerce_shipping_pane_checkout_form($form, &$form_state, $checkout_pan
       }
     }
 
+    // Delete any existing shipping line items from the order.
+    commerce_shipping_delete_shipping_line_items($order, TRUE);
+
+    // Extract the unit price from the calculated rate.
+    $rate_line_item = $pane_form['shipping_rates']['#value'][$default_value];
+    $rate_line_item_wrapper = entity_metadata_wrapper('commerce_line_item', $rate_line_item);
+    $unit_price = $rate_line_item_wrapper->commerce_unit_price->value();
+
+    // Create a new shipping line item with the calculated rate from the form.
+    $line_item = commerce_shipping_line_item_new($pane_form['shipping_service']['#default_value'], $unit_price, $order->order_id, $rate_line_item->data, $rate_line_item->type);
+
+    // Add the service details to the line item's data array and the order.
+    $line_item->data['service_details'] = $pane_form['service_details'];
+
+    // Allow the details form submit handler to make any necessary updates to
+    // the line item before adding it to the order.
+    if ($callback = commerce_shipping_service_callback($shipping_service, 'details_form_submit')) {
+      $callback($pane_form['service_details'], $pane_values['service_details'], $line_item);
+    }
+
+    // Save and add the line item to the order.
+    commerce_shipping_add_shipping_line_item($line_item, $order);
+
     $pane_form['service_details']['#prefix'] = '<div id="commerce-shipping-service-details">';
     $pane_form['service_details']['#suffix'] = '</div>';
   }
