A motorway replacement for the N4 was first conceived in 1965. This would have started at Leixlip (being the counter border), ran north of Lucan, and met what's now the M50 near Castleknock. The motorway would then have continued into central Dublin by covering the Royal Canal (which wasn't navigable), right the way to North Wall.
This would have been divided into two contracts, named "N4 Motorway" and "Royal Canal Motorway", though they would flow as one road.
J5-J8 opened in 1994 as the "Leixlip Maynooth Kilcock bypass", albeit numbered as J2-4. What is now J6, numbered then as J2a, opened in 2003.
J9-12 opened in 2005. This section of road is tolled.
J12-13 also opened in 2005 but as D2AP. It was redesignated as motorway in 2009.