As the 60th anniversary of Indian Partition approaches, the BBC's Andrew Whitehead looks back at how and why independence from Britain meant the creation of two separate countries, India and Pakistan.
Poor relations between Nehru (left) and Jinnah boded ill
"There can be no question of coercing any large areas in which one community has a majority to live against their will under a government in which another community has a majority. And the only alternative to coercion is partition."
With those words, the last Viceroy of British India, Lord Mountbatten, announced that Britain would be granting independence not to one nation, but to two. All Britain's attempts to devise a constitutional formula which preserved India's unity while offering safeguards for the large Muslim minority had failed.
Mountbatten's speech was made on 3 June 1947. Just 10 weeks later, he was presiding at twin independence ceremonies.
In Karachi on 14 August, he witnessed the birth of a nation with an explicit Muslim identity, Pakistan. The following day, he was in Delhi for India's independence ceremonies - a country more than three times the population of Pakistan and with a large Hindu majority.
The BBC News website's coverage of the anniversary of partition will include personal testimonies from survivors of the massacres, a focus on Muslims in India and on Kashmiri nationhood, and a stocktake of political and social conditions in the three successor nations of British India.
In those hectic weeks between the announcement of partition and the transfer of power, a British judge, Cyril Radcliffe, was brought in to devise the border between India and Pakistan. It meant cutting in half two of India's most powerful and populous provinces, Punjab and Bengal.
Radcliffe had never been to India before and never came again. Whatever line he had devised, tens of millions would have felt aggrieved. The hasty partition of these provinces triggered one of the greatest tragedies of the 20th Century.
Tens of millions of Muslims on one side, and Hindus and Sikhs on the other, found themselves on what they regarded as the wrong side of the boundary line. Amid the tension, the communal clashes and the panicked mass migration, there was huge loss of life. No one knows the exact number.
Partition saw as many as half a million people killed
Historians believe that upwards of half a million people were killed, tens of thousands of women were raped or abducted and more than 10 million people became refugees in a catastrophe which still haunts South Asian politics and diplomacy.
India's demands for self-rule dated back to the previous century, and gained particular force in the 1920s and 1930s under the leadership of the Hindu ascetic and campaigning genius, Mahatma Gandhi.
By 1945, and the end of World War II, it was clear that self-rule for India was imminent. The landslide victory of a radical-minded Labour party in Britain's 1945 elections hastened the process.
The complicating factor was that many in India's large Muslim minority felt they would be at a disadvantage in a mainly Hindu nation.
The Muslim League, led by austere lawyer Mohammed Ali Jinnah, took up this issue.
It was as late as 1940 that the Muslim League started demanding a separate nation for the region's Muslims. But the League's strong showing in post-war provincial elections meant that their demand for a separate Pakistan could not be ignored.
The terrible violence between communities which so tarnished independence began in Calcutta (now Kolkata) a year before the British transferred power and slowly spread.
But it was only after the independence ceremonies - and then, two days later, the announcement of where the boundary would run - that Punjab became engulfed in the worst of the Partition bloodletting.
Punjab was home to a large and influential Sikh population, who dominated much of the region's agriculture but there was hardly anywhere where Sikhs were in a majority and their lands and most important places of worship straddled the new Partition line.
Almost all Sikhs felt more comfortable in India than in Pakistan - hundreds of thousands moved in endless caravans, some 70 miles long, in the monsoon months of 1947. So did many Hindus. Roughly equal numbers of Muslims made their way to Pakistan.
There was little pattern to the violence. All communities suffered, all harboured perpetrators. It was vicious - almost unbelievably so. Columns of refugees were attacked, harried and sometimes slaughtered.
Trainloads of migrants were put to death, their bodies sometimes horribly butchered and disfigured. On both sides, women were particular targets for violence and impregnation.
The debate about whether Partition was right or wrong, whether it was inevitable or avoidable, has receded over the years.
THE PARTITION IN VERSE
...In seven weeks it was done, the frontiers decided,
A continent for better or worse divided
from Partition by WH Auden
Corpses lie strewn in your [the Punjab's] pastures
and the Chenab [river] has turned crimson
from An Ode to Waris Shah by Amrita Pritam
Somewhere the wave of the slow night will meet the shore
and somewhere will anchor the boat of the heart's grief
from Freedom's Dawn by Faiz Ahmad Faiz
But historians in South Asia by and large agree that if Britain had sought a less hasty and better prepared transfer of power, much of the bloodshed could have been avoided.
Pakistan's founder, Jinnah, and India's first Prime Minister, Jawaharlal Nehru, never got on well. The tension and appalling violence which overshadowed their nations' births made matters much worse. Countries which could have been good neighbours turned out to be enemies right from the start.
The Kashmir issue intensified the sense of conflict. Kashmir lay between India and Pakistan. It had a Muslim majority but a Hindu princely ruler had to make the decision about which country to join.
Pakistan tried to force the issue, encouraging first a local uprising and then an invasion by Pakistani tribesmen. The maharaja pleaded to India for help, and Indian troops airlifted into the Kashmir Valley succeeded in blocking the tribal army's advance.
Within months of independence, India and Pakistan were at war in Kashmir. The dispute has never been resolved. Kashmir has endured its own informal partition with the Muslim-majority Kashmir Valley, the heartland of Kashmiri culture, under Indian control but still claimed by Pakistan.
Pakistan had the acute problem of geography. It consisted of two wings, Bengali-speaking East Pakistan, and Punjabi-dominated West Pakistan, with 1,000 miles of Indian territory in between.
The East had just the larger population - but power and influence lay with the West. In 1971, Indian troops supported Bengali nationalists in prising East Pakistan free of West Pakistan's control, and the new nation of Bangladesh was born.
Defined by the differences
The wars and rivalry between India and Pakistan have encouraged both countries to build strong armies (in Pakistan, the army has repeatedly overthrown civilian governments) and to develop nuclear arsenals.
Pakistan went on to challenge India as a regional power
Regional co-operation in South Asia has been perpetually frustrated by this rivalry. India still has a large Muslim minority, about one in seven of the population, but the tension with Pakistan has put strain on the Indian tradition of secularism in public life and religious tolerance.
The start of a separatist insurgency in Kashmir from the end of the 1980s further worsened relations between the two countries.
Pakistan insisted it was only giving moral support to the separatists - India was convinced that Pakistan was arming, training and at times organising these Muslim militants.
Some were advocates of jihad who had been supported by Pakistan in fighting Soviet rule in Afghanistan and then turned their attention to Kashmir - and have also trained and encouraged Islamic radicals who have sought targets further afield.
Both India and Pakistan have struggled to escape the shadow of the violence amid which they gained nationhood. Kashmir is only one aspect of the unfinished business of Partition. Both national identities are defined in large part by contrast with the other.
Yet India and Pakistan have - hesitatingly, and sometimes painfully - been struggling towards building better links. If that happens, South Asia will finally have managed to supersede the bitter legacy of 1947.