Plans for a railway between Copenhagen and Helsingør had been proposed since the childhood of railways. The North Line was built though Helsingør in 1864 and in 1863 the connection between Copenhagen and Klampenborg Station as a sort of daytrip and tourist route. In 1890 the Minister of the Interior, Hans Peter Ingerslev, a proposition of a state railway between Klampenborg and Helsingør, but it went four years of discussion and negotiations before the surveyors could stop their work and the construction workers enter the field. The Ministry of War wanted to have a railway to Vedbæk, as long as it wasn't built so close to the coast that it could be bombarded by a foreign naval fleet in Øresund, and as long as the railway could be removed quickly. The Forestry Department didn't have any objections against the railway as long as not even a single tree was cut down. A number of citizens also were active in the debate about the choice of route and placing of stations. Because of rules decided by the Ministry of War, the railway had to go in a large curve out over the lakes to Nørrebro and onwards towards the Øresund Coast at Hellerup. Hellerup station was built in the 1860s because it was where the North Line and the Klampenborg Line split, and not because there was a need for a station at the place. The stretch between Østerport and Hellerup was first taken into use with the opening of the Coast Line in 1897. Østerport was the initial terminus of the line, was originally called Kystbanestationen, Østerbro, København Ø and Østbanegaarden. Architect Heinrich Wenk, who drew many of the stations on the railway, was also responsible for the Eastern Station, that after decree from the Ministry of War was constructed as a temporary building. First 20 years later the line between Copenhagen Central Station and Østerport was taken into use, and the Coast Line got its present form on 1 December 1917.
In 2007 the Danish government in cooperation with Skånetrafiken announced it would invite transportation companies to take over the Coast Line. Several European operators most notably SJ, Arriva, Connex, and DSBFirst. DSBFirst won this bid due to their plan of introducing 7-Eleven to the majority of stations, keeping the current system of permanently staffed trains, and promising better scheduling. Moreover, there was a sense that it was more convenient because DSB already had trains suited to operate under the two different volt systems used for railway electrification in Denmark and Sweden. Despite serving food and coffee for passengers on their first Monday of operation, they did not win over passengers as the trains were delayed and packed. For the next few months the trains had an average delay percentage of 10, causing outcry among frequent passengers and a massive drop in rating. As of June 2009, DSBFirst managed to regain much passenger support through fewer delayed trains due to a change in timetables and better education of the train managers.
Rolling stock
The unique feature of the Coast Line is that despite that there is only between three and six minutes between each station, it has not been operated by S-trains. Lately the line has been operated by modern and comfortable trains, including DSB's first electric locomotives, litra EA and the new electric regional trainlitra ER, started service the Coast Line in the mid 1990s. Today the main service on the line is Oresund trains that operate between Helsingør via Copenhagen and Copenhagen Airport to Malmö in Sweden and ER trains between Nivå and Kastrup. In rush hour, these trains are supplemented with higher speed commuter train operated with various stock. The replacement of steam locomotive with diesel multiple units started in 1935, but was first completed in 1965. Originally the Coast Line was operated by litra K and litra Osteam engines and later by litra S engines that were acquired in the 1920s. From about 1960 the main stock was the diesel electric locomotives MX, MY and later MZ and ME. Electrification of the railway started in Nivå in 1982 and was completed on 19 March 1986 when the electric operation was initialized with litra EA locomotives.