Power was transferred to Pakistan's founding father, Muhammad Ali Jinnah, on August 14, 1947, by Lord Louis Mountbatten, the last viceroy of British India and the first governor-general of the Dominion of India.
Jinnah was head of the All-India Muslim League, which had led the growing demands during the 1940s for a separate homeland for the Muslim minority of South Asia as the incidence of violence between Muslims and Hindus increased.
Under the Mountbatten Plan approved earlier in 1947, Pakistan was created out of north-western and eastern parts the British-ruled Indian subcontinent, while the rest became modern-day India.
Both were granted dominion status as step towards obtaining full independence. The eastern part of Pakistan became Bangladesh after independence from Islamabad in 1971.
What happened on August 14, 1947?
The division in 1947, known as the Partition, was followed by widespread violence between Hindus, Muslims and Sikhs as millions migrated between the newly created states according to their religion.
At the time, Zia Ul Haq was a captain in the Indian army, who helped escort refugees from India during the period of intense inter-communal violence. Taking the last refugees from Babina in Uttar Pradesh would prove a formative experience for the young captain, who would rule Pakistan between 1978 and 1988.
It's thought that around ten million Muslims fled India during this time, while a similar number of Hindus were displaced and fled to India. Hundreds of thousands, perhaps up to two million people, died in the violence.
For Jinnah, however, the unrest would ultimately lead to something positive: the birth of a homeland for Muslims in the region.
"August 14 is the birthday of the independent and sovereign state of Pakistan," he said, of the country's founding.
"It marks the fulfillment of the destiny of the Muslim nation which made great sacrifices in the past few years to have its homeland."
In a speech during the handover of power to the newly sovereign Pakistan, Jinnah said he hoped the country - envisioned as a parliamentary democracy by its first prime minister Liaquat Ali Khan - would be a place of "no discrimination, no distinction between one community and another, no discrimination between one caste or creed and another".
“We are all citizens and equal citizens of one state.”
Despite Pakistan's origins as a homeland for Muslims, Jinnah insisted that the new country would guarantee religious freedom for all.
People “may belong to any religion, or caste, or creed — that has nothing to do with the business of the state”, he said an address to the Constituent Assembly of Pakistan in August 1947.
How is Independence Day celebrated?
Jinnah died the following year, but his legacy remains a central theme of independence day celebrations.
The main celebration takes place in Islamabad, where the national flag is raised at the Presidential and Parliament buildings and the country’s leadership makes televised speeches to the nation.
Cultural songs, parades, flag-raising ceremonies and fireworks are seen across Pakistan on the day.
Street traders and shops have been selling thousands of flags and patriotic accessories in the past week.