Copenhagen (IPA /ˈkoʊpənheɪɡən/ or /ˈkoʊpənhɑːɡən/; Danish: København [kʰøb̥m̩ˈhɑʊ̯ˀn] ( listen); Swedish: Köpenhamn) is the capital of Denmark and its most populous city, with an urban population of 1,213,822 (as of 1 January 2012) and a metropolitan population of 1,950,522 (as of 1 January 2013). With the completion of the transnational Øresund Bridge in 2000, Copenhagen has become the centre of the increasingly integrated Øresund Region. Within this region, Copenhagen and the Swedish city of Malmö are growing into a combined metropolitan area. Copenhagen is situated on the islands of Zealand and Amager.
Copenhagen became the capital of Denmark in the beginning of the 15th century, while being documented as such since the 11th century. During the 17th century, under the reign of Christian IV, it became a significant regional centre.
Copenhagen is a major regional center of culture, business, media, and science, as indicated by several international surveys and rankings (see International rankings below). Life science, information technology and shipping are important sectors, and research & development plays a major role in the city’s economy. Its strategic location and excellent infrastructure, with the largest airport in Scandinavia,Copenhagen Airport, Kastrup, located 14 minutes by train from the city centre, have made it a regional hub and a popular location for regional headquarters and conventions.
Copenhagen has repeatedly been recognized as one of the cities with the best quality of life. It is also considered one of the world’s most environmentally friendly cities. The water in the inner harbour is clean and safe for swimming. 36% of all citizens commute to work by bicycle. Every day, they cycle a combined 1.2 million km.
Since the turn of the millennium, Copenhagen has seen a strong urban and cultural development. This is partly due to massive investments in cultural facilities as well as infrastructure and a new wave of successful designers, chefs and architects.
Copenhagen’s founding has traditionally been dated to Bishop Absalon’s construction of a castle on the small island of Slotsholmen in 1167 where Christiansborg Palace stands today. Recent archaeological finds indicate that by the 11th century, Copenhagen had already grown into a small town with a large estate, a church, a market, at least two wells and many smaller habitations spread over a fairly wide area. Many historians believe that the town dates to the late Viking age, and was possibly founded by Sweyn I Forkbeard. From the middle of the 12th century it grew in importance, after coming into Absalon’s possession, who fortified it in 1167, the year traditionally marking the foundation of Copenhagen. The excellent harbour encouraged Copenhagen’s growth until it became an important centre of commerce. However it did not become the nation’s capital until the middle of the 15th century, and the archbishop still has residence in Roskilde.
The city’s origin as a harbour and a place of commerce is reflected in its name. Its original designation, from which the contemporary Danish name is derived, was Køpmannæhafn, meaning «merchants’ harbour». The English cognate would be Chapman’s haven. The English name for the city is derived from its Low German name, Kopenhagen. The element hafnium is also named for Copenhagen, whose Latin name is Hafnia, derived from the city’s original name, Hafnæ («harbour»). The bacterium Hafnia is also named after Copenhagen, being coined in 1954 by Vagn Møller of the Statens Seruminstitut in Copenhagen. 
As the town rose in prominence, it was repeatedly attacked by the Hanseatic League. In 1254 it received its charter as a city under Bishop Jakob Erlandsen. During 1658–59 it withstood a siege by the Swedes under Charles X and successfully repelled a major assault. In 1711 the plague reduced Copenhagen’s population of about 65,000 by one-third.
On 2 April 1801 a British fleet under the command of Admiral Sir Hyde Parker defeated a Danish-Norwegian fleet anchored near Copenhagen. Vice-Admiral Horatio Nelson led the main attack. He famously disobeyed Parker’s order to withdraw, destroying many of the Dano-Norwegian ships before a truce was agreed. Copenhagen is often considered to be Nelson’s hardest-fought battle, surpassing even the heavy fighting at Trafalgar. It was during this battle that Lord Nelson famously «put the telescope to the blind eye» in order not to see Admiral Parker’s signal to cease fire.
The Second Battle of Copenhagen (or the Bombardment of Copenhagen) (16 August – 5 September 1807) was from a British point of view a preemptive attack on Copenhagen, targeting the civilian population in order to seize the Dano-Norwegian fleet. But from a Danish point of view the battle was a terror bombardment on their capital. Particularly notable was the use of incendiary Congreve rockets (containing phosphorus, which cannot be extinguished with water) that randomly hit the city. Few houses with straw roofs remained after the bombardment. The largest church, Vor frue kirke, was destroyed by the sea artillery. Several historians consider this battle was the first terror attack against a major European city in modern times. The confiscation of the navy, would later source the term to Copenhagenize.
Slotsholmen canal, as seen from Børsen (1890–1900). In the background from left to right: Church of the Holy Ghost, Rundetårn, Trinity Church, St. Nicholas Church (before the spire was rebuilt) and Holmen Church.
The British landed 30,000 men and surrounded Copenhagen. The attack continued for the next three days, killing some 2,000 civilians and destroying most of the city. The devastation was so great because Copenhagen relied on an old defence-line whose limited range could not reach the British ships and their longer-range artillery. Not until the 1850s were the ramparts of the city opened to allow new housing to be built around The Lakes (Danish: Søerne) that bordered the old defences to the west. This dramatic increase of space was long overdue, because the old ramparts were out of date as a defence system, and because of bad sanitation in the old city. Before the opening, central Copenhagen was inhabited by approximately 125,000 people, peaking in the census of 1870 (140,000); today the figure is around 25,000. In 1901, Copenhagen expanded further, incorporating communities with 40,000 people, and in the process making Frederiksberg an enclave within Copenhagen.
During World War II, Copenhagen was occupied by German troops along with the rest of the country from 9 April 1940 until 4 May 1945. The occupation was not a part of the Nazi German expansion, and in the first years German authorities wanted a kind of understanding with the Danish government. Even a general parliamentary election was granted in 1943, with only the Communist Party excluded. But in August 1943, when the government’s collaboration with the occupation forces collapsed, several ships were scuttling in Copenhagen Harbour by the Royal Danish Navy to prevent their use by the Germans. Around that time the Nazis started to arrest Jews, although many managed to escape to Sweden.
After the Normandy invasion the Germans feared that the Danish police could become a problem, and in early September 1944 the entire Danish police force was meant to be arrested. But a majority of the Danish police managed to either hide or escape to Sweden. Out of 2,000 policemen captured and deported to Germany fewer than half returned after the war. During the last eight months of occupation Copenhagen suffered a high rate of common criminality.
Ole Lippman, the leader of the Danish resistance movement (SOE), asked for RAF assistance in attacking Nazi headquarters in Copenhagen. Accordingly, vice Air Marshall Sir Basil Embry drew the plans for a spectacular precision attack on the SD and Gestapo building, the former office of the Shell Oil Company. Political prisoners were kept in the attic to prevent an air raid, so the RAF had to bomb the lower levels of the building. The attack came on 22 March 1945, coming in three small waves. All six planes (carrying one bomb each) in the first wave hit their target, but unfortunately one of the aircraft crashed near Frederiksberg girls school. Due to this crash four of the planes in the two following waves assumed the school was the target, and aimed their bombs at the school. 123 civilians (of which 87 were young girls) were killed. However from the Shell-building, 18 of a total of 26 political prisoners managed to escape, the Gestapo archives were completely destroyed, and Hitler became so insecure of the situation that he withdrew only half of the roughly 200,000 soldiers in Denmark to reinforce German forces on the Rhine.
Since the summer of 2000, Copenhagen and the Swedish city of Malmö have been connected by a toll bridge/tunnel (Øresund Bridge), which carries railroad and automobile traffic. As a result, Copenhagen has become the centre of a larger metropolitan area which spans both nations. The construction of the bridge has led to many changes to the public transport system and extensive redevelopment of Amager, south of Copenhagen.
In December 2009 Copenhagen hosted the worldwide climate meeting COP15. When US President Barack Obama participated in the end of this meeting it was the fourth time an American President had visited Copenhagen during his term (Obama also visited Copenhagen in October 2009, George W. Bush in 2005 and Bill Clinton in the 1990s).