diff --git a/bgpd/bgp_aspath.c b/bgpd/bgp_aspath.c
index e8559be..cfa9bc1 100644
--- a/bgpd/bgp_aspath.c
+++ b/bgpd/bgp_aspath.c
@@ -476,6 +476,19 @@
   return highest;
 }
 
+/* Return the left-most ASN in path */
+as_t
+aspath_leftmost (struct aspath *aspath)
+{
+  struct assegment *seg = aspath->segments;
+  as_t leftmost = 0;
+
+  if (seg && seg->length && seg->type == AS_SEQUENCE)
+    leftmost = seg->as[0];
+
+  return leftmost;
+}
+
 /* Return 1 if there are any 4-byte ASes in the path */
 unsigned int
 aspath_has_as4 (struct aspath *aspath)
@@ -1362,46 +1375,50 @@
 
 /* Add specified AS to the leftmost of aspath. */
 static struct aspath *
-aspath_add_one_as (struct aspath *aspath, as_t asno, u_char type)
+aspath_add_asns (struct aspath *aspath, as_t asno, u_char type, unsigned num)
 {
   struct assegment *assegment = aspath->segments;
+  int i;
 
-  /* In case of empty aspath. */
-  if (assegment == NULL || assegment->length == 0)
+  if (assegment && assegment->type == type)
     {
-      aspath->segments = assegment_new (type, 1);
-      aspath->segments->as[0] = asno;
-      
-      if (assegment)
-	assegment_free (assegment);
-
-      return aspath;
+      /* extend existing segment */
+      aspath->segments = assegment_prepend_asns (aspath->segments, asno, num);
     }
-
-  if (assegment->type == type)
-    aspath->segments = assegment_prepend_asns (aspath->segments, asno, 1);
   else 
     {
-      /* create new segment
-       * push it onto head of aspath's segment chain 
-       */
-      struct assegment *newsegment;
-      
-      newsegment = assegment_new (type, 1);
-      newsegment->as[0] = asno;
-      
-      newsegment->next = assegment;
+      /* prepend with new segment */
+      struct assegment *newsegment = assegment_new (type, num);
+      for (i = 0; i < num; i++)
+	newsegment->as[i] = asno;
+
+      /* insert potentially replacing empty segment */
+      if (assegment && assegment->length == 0)
+	{
+	  newsegment->next = assegment->next;
+	  assegment_free (assegment);
+	}
+       else
+	  newsegment->next = assegment;
       aspath->segments = newsegment;
     }
 
+  aspath_str_update (aspath);
   return aspath;
 }
 
+/* Add specified AS to the leftmost of aspath num times. */
+struct aspath *
+aspath_add_seq_n (struct aspath *aspath, as_t asno, unsigned num)
+{
+  return aspath_add_asns (aspath, asno, AS_SEQUENCE, num);
+}
+
 /* Add specified AS to the leftmost of aspath. */
 struct aspath *
 aspath_add_seq (struct aspath *aspath, as_t asno)
 {
-  return aspath_add_one_as (aspath, asno, AS_SEQUENCE);
+  return aspath_add_asns (aspath, asno, AS_SEQUENCE, 1);
 }
 
 /* Compare leftmost AS value for MED check.  If as1's leftmost AS and
@@ -1600,7 +1617,7 @@
 struct aspath*
 aspath_add_confed_seq (struct aspath *aspath, as_t asno)
 {
-  return aspath_add_one_as (aspath, asno, AS_CONFED_SEQUENCE);
+  return aspath_add_asns (aspath, asno, AS_CONFED_SEQUENCE, 1);
 }
 
 /* Add new as value to as path structure. */
diff --git a/bgpd/bgp_aspath.h b/bgpd/bgp_aspath.h
index e8764cc..1311f8a 100644
--- a/bgpd/bgp_aspath.h
+++ b/bgpd/bgp_aspath.h
@@ -71,6 +71,7 @@
 extern struct aspath *aspath_aggregate (struct aspath *, struct aspath *);
 extern struct aspath *aspath_prepend (struct aspath *, struct aspath *);
 extern struct aspath *aspath_filter_exclude (struct aspath *, struct aspath *);
+extern struct aspath *aspath_add_seq_n (struct aspath *, as_t, unsigned);
 extern struct aspath *aspath_add_seq (struct aspath *, as_t);
 extern struct aspath *aspath_add_confed_seq (struct aspath *, as_t);
 extern int aspath_cmp (const void *, const void *);
@@ -97,6 +98,7 @@
 extern unsigned int aspath_count_confeds (struct aspath *);
 extern unsigned int aspath_size (struct aspath *);
 extern as_t aspath_highest (struct aspath *);
+extern as_t aspath_leftmost (struct aspath *);
 extern size_t aspath_put (struct stream *, struct aspath *, int);
 
 extern struct aspath *aspath_reconcile_as4 (struct aspath *, struct aspath *);
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index b74554d..857781f 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -1230,7 +1230,6 @@
 
   if (type == RMAP_BGP)
     {
-      aspath = rule;
       binfo = object;
     
       if (binfo->attr->aspath->refcnt)
@@ -1238,20 +1237,50 @@
       else
 	new = binfo->attr->aspath;
 
-      aspath_prepend (aspath, new);
+      if ((uintptr_t)rule > 10)
+      {
+	aspath = rule;
+	aspath_prepend (aspath, new);
+      }
+      else
+      {
+	as_t as = aspath_leftmost(new);
+	if (!as) as = binfo->peer->as;
+	new = aspath_add_seq_n (new, as, (uintptr_t) rule);
+      }
+
       binfo->attr->aspath = new;
     }
 
   return RMAP_OKAY;
 }
 
+static void *
+route_set_aspath_prepend_compile (const char *arg)
+{
+  unsigned int num;
+
+  if (sscanf(arg, "last-as %u", &num) == 1 && num > 0 && num < 10)
+    return (void*)(uintptr_t)num;
+
+  return route_aspath_compile(arg);
+}
+
+static void
+route_set_aspath_prepend_free (void *rule)
+{
+  if ((uintptr_t)rule > 10)
+    route_aspath_free(rule);
+}
+
+
 /* Set as-path prepend rule structure. */
 struct route_map_rule_cmd route_set_aspath_prepend_cmd = 
 {
   "as-path prepend",
   route_set_aspath_prepend,
-  route_aspath_compile,
-  route_aspath_free,
+  route_set_aspath_prepend_compile,
+  route_set_aspath_prepend_free,
 };
 
 /* `set as-path exclude ASn' */
@@ -3127,6 +3156,15 @@
   return ret;
 }
 
+ALIAS (set_aspath_prepend,
+       set_aspath_prepend_lastas_cmd,
+       "set as-path prepend (last-as) <1-10>",
+       SET_STR
+       "Transform BGP AS_PATH attribute\n"
+       "Prepend to the as-path\n"
+       "Use the peer's AS-number\n"
+       "Number of times to insert");
+
 DEFUN (no_set_aspath_prepend,
        no_set_aspath_prepend_cmd,
        "no set as-path prepend",
@@ -3983,6 +4021,7 @@
   install_element (RMAP_NODE, &no_set_metric_cmd);
   install_element (RMAP_NODE, &no_set_metric_val_cmd);
   install_element (RMAP_NODE, &set_aspath_prepend_cmd);
+  install_element (RMAP_NODE, &set_aspath_prepend_lastas_cmd);
   install_element (RMAP_NODE, &set_aspath_exclude_cmd);
   install_element (RMAP_NODE, &no_set_aspath_prepend_cmd);
   install_element (RMAP_NODE, &no_set_aspath_prepend_val_cmd);
diff --git a/doc/bgpd.texi b/doc/bgpd.texi
index de70970..5004cbf 100644
--- a/doc/bgpd.texi
+++ b/doc/bgpd.texi
@@ -496,6 +496,7 @@
 @end deffn
 
 @deffn {Route Map} {set as-path prepend @var{as-path}} {}
+@deffnx {Route Map} {set as-path prepend last-as @var{num}} {}
 @end deffn
 
 @node Private AS Numbers
