Ever since the partition of the sub-continent in 1947, when Britain dismantled its Indian empire, India and Pakistan have been arch rivals.
The animosity has its roots in religion and history, and is epitomised by the long-running conflict over the state of Jammu and Kashmir. This has recently escalated into a dangerous nuclear arms race.
The Indian subcontinent was partitioned into Hindu-dominated but nominally secular India and the newly created Muslim state of Pakistan after India's independence from Great Britain in 1947. Severe rioting and population movement ensued and an estimated half a million people were killed in communal violence. About a million people were left homeless. Since partition, the territory of Jammu and Kashmir has remained in dispute, with Pakistan and India both holding sectors.
The name Pakistan was derived from an idea first suggested in 1933 when a student, Chaudhuri Rahmat Ali, proposed that there should be a separate homeland which would be comprised of the Muslim-majority provinces in the north-west as well as the geographically contiguous princely state of Jammu and Kashmir.
The name was formulated from: P for Punjab, A for the Afghanis of the north-west frontier, K for Kashmir, S for Sind and Tan denoting Baluchistan. The word also means land of the pure in Urdu.
The partition of the Subcontinent, however, led to severe rioting and population movement as Muslims, Sikhs and Hindus found themselves on the wrong side of the partitioned provinces of Punjab and Bengal. The latter of these became East Pakistan. An estimated half a million people died in communal violence, millions more became homeless.
Jammu and Kashmir, a collection of culturally distinct regions, were nominally brought under the rule of Sikhs in the early 19th Century. After the British fought the Sikhs in 1846, instead of assuming direct control over the area, Britain installed a Hindu ruler as Maharaja.
The Maharaja's territorial possessions included the Buddhist area of Ladakh, the predominantly Hindu region of Jammu, the majority Muslim valley of Kashmir, as well as smaller Muslim kingdoms in the west.
In the days of the British Empire, the state of Jammu and Kashmir was one of more than 560 autonomous princely states owing allegiance to Britain. At independence, the rulers were advised to join, by means of an instrument of accession, either of the two new dominions, India or Pakistan, bearing in mind their state's geographical position and the religion of their inhabitants.
By August 1947, the date of partition, the ruler of Jammu and Kashmir had not decided which dominion to join.
Over 50 years later, Pakistanis still believe that Jammu and Kashmir should have become part of Pakistan because the majority of the state's population, concentrated in the valley of Kashmir, is Muslim.
India, says the state of Jammu and Kashmir belongs to India because by the October 1947 instrument of accession, the Maharaja finally agreed to join India.
India and Pakistan first went to war in October 1947 after Pakistan supported a Muslim insurgency in Kashmir. India agreed to a request for armed assistance from Kashmir's Maharaja, in return for accession of the state to India. But the nature of that accession has long been the subject of debate. The war ended on 1 January 1949, with the establishment of a ceasefire line.
The status of the territory remained in dispute because an agreed referendum to confirm the accession was never held.
The first Indo-Pakistani war started after armed tribesmen from Pakistan's north-west frontier province invaded Kashmir in October 1947. Besieged both by a revolt in his state and by the invasion, the Maharaja requested armed assistance from the government of India. In return he acceded to India, handing over powers of defence, communication and foreign affairs.
Both India and Pakistan agreed that the accession would be confirmed by a referendum once hostilities had ceased.
Historians continue to debate the precise timing when the Maharaja of Jammu and Kashmir signed the instrument of accession and the Indian army moved into the state, arguing that the Maharaja acceded to India under duress.
In May 1948, the regular Pakistani army was called upon to protect Pakistan's borders. Fighting continued throughout the year between Pakistani irregular troops and the Indian army.
The war ended on 1 January 1949 when a ceasefire was arranged by the United Nations, which recommended that both India and Pakistan should adhere to their commitment to hold a referendum in the state. A ceasefire line was established where the two sides stopped fighting and a UN peacekeeping force established. The referendum, however, has never been held.
In 1954 Jammu and Kashmir's accession to India was ratified by the state's constituent assembly. In 1957, it approved its own constitution, modelled along the Indian constitution. Since that time India has regarded that part of the state which it controls as an integral part of the Indian union.
To the west of the ceasefire line, Pakistan controls roughly one third of the state. A small region, which the Pakistanis call Azad (Free) Jammu and Kashmir, and the Indians call Pakistani-occupied Kashmir, is semi-autonomous. The larger area, which includes the former kingdoms of Hunza and Nagar, called the northern areas, is directly administered by Pakistan.
In 1962-1963, following the 1962 Sino-Indian war, India and Pakistan held talks under the auspices of Britain and the US in an attempt to resolve their differences over Kashmir, but without success.
The two countries went to war again after Pakistan launched a covert offensive across the ceasefire line into Indian-administered Jammu and Kashmir. India retaliated by crossing the international border at Lahore.
In April 1965, a clash between border patrols erupted into fighting in the Rann of Kutch, a sparsely inhabited region along the south-western Indo-Pakistani border. When the Indians withdrew, Pakistan claimed victory.
Later, in August, hostilities broke out again in the 2nd Indo-Pakistani war, when the government of Pakistan launched a covert offensive across the ceasefire line into the Indian-administered Jammu and Kashmir. In early September, India retaliated by crossing the international border at Lahore. After three weeks, both India and Pakistan agreed to a UN-sponsored ceasefire.
In January 1966, the governments of India and Pakistan met at Tashkent and signed a declaration affirming their commitment to solve their disputes through peaceful means. They also agreed to withdraw to their pre-August positions.
Indo-Pakistani relations deteriorated again when civil war erupted in Pakistan, pitting the West Pakistan army against East Pakistanis demanding autonomy and later independence.
The fighting forced an estimated 10 million East Pakistani civilians to flee to India.
In December India invaded East Pakistan in support of the East Pakistani people. The Pakistani army surrendered at Dhaka and its army of more than 90,000 became Indian prisoners of war.
East Pakistan became the independent country of Bangladesh on 6 December 1971.
Regional tensions were reduced by the Simla accord of 1972 and by Pakistan's recognition of Bangladesh in 1974. The Simla accord committed both sides to working through outstanding issues bilaterally and through the mechanism of working groups.
In relation to Jammu and Kashmir, the two countries agreed that the ceasefire line, which was renamed the Line of Control, would be respected by both sides "without prejudice to the recognised positions of either side".
In 1974 the Kashmir state government reached an accord with the Indian Government, which affirmed its status as "a constituent unit of the union of India". Pakistan rejected the accord.
Armed resistance to Indian rule broke out in the Kashmir valley in 1989, with some groups calling for independence and others calling for union with Pakistan. India accused Pakistan of supplying weapons to the militants. During the 1990s, with the emergence of militant Muslim groups, the movement's ideology became essentially Islamic in nature.
In 1989 armed resistance to Indian rule began in the Kashmir valley. Muslim political parties complained that the 1987 elections to the state's legislative assembly were rigged against them, and they formed militant wings.
Some groups demanded independence for the state of Jammu and Kashmir and others union with Pakistan.
Pakistan gave its "moral and diplomatic" support to the movement, calling for the issue to be resolved via a UN-sponsored referendum.
But the government of India maintained that Pakistan's support of the insurgency consisted of training and supplying weapons to militant separatists and repeatedly called for Pakistan to cease "cross-border terrorism".
During the 1990s, several new militant groups emerged, most of which held radical Islamic views.
The ideological emphasis of the movement shifted from a nationalistic and secularist one to an Islamic one.
This was in part driven by the arrival in the valley of Kashmir of large numbers of Islamic "Jihadi" fighters who had fought in Afghanistan against the Soviet Union in the 1980s.
India and Pakistan set up low-level meetings to defuse tension over Jammu and Kashmir. The diplomatic push became more concerted a year later and an agenda for peace talks was agreed on. Also in 1997, Pakistan suggested that the two sides meet to discuss restraining nuclear and missile capabilities.
In 1996, Pakistani and Indian military officers met on the Line of Control dividing the state of Jammu and Kashmir to ease tension after clashes.
The celebrations of 50 years of independence in 1997 in both countries coincided with a surge in diplomatic activity. During 1997, Indian and Pakistani foreign ministers met in Delhi.
After a second round of talks in Islamabad, they announced an eight-point agenda for peace talks, including discussion of the Kashmir issue. Although the talks ended in stalemate, both sides promised to meet again.
In a speech at the UN, Pakistani Prime Minister Nawaz Sharif offered to open talks on a non-aggression pact with India, proposing that both nations strike a deal to restrain their nuclear and missile capabilities.
In 1988 India and Pakistan had signed an agreement not to attack each other's nuclear facilities.
India has consistently rejected any third party mediation to help end Kashmir border clashes, saying differences should be solved in bilateral talks, according to the 1972 Simla agreement.
The 1980s had seen some diplomatic discussions aimed at resolving outstanding differences, between India and Pakistan. In 1982, the two rivals began unsuccessful talks on a non-aggression treaty. However, in 1984 Indian troops were airlifted to the Siachen glacier in northern Kashmir which increased tension in the area.
Pakistan retaliated by fortifying the glacier from its side of what has become known as the world's highest war zone.
Fears of a nuclear confrontation grew, after both sides conducted nuclear tests. The US ordered sanctions against both countries, with several European nations doing the same. Tensions were reduced early the following year after the two sides signed an accord pledging to intensify efforts to resolve all issues – including that of Jammu and Kashmir.
The arms race between the rivals escalated dramatically in the 1990s.
In May 1998, India conducted underground nuclear tests in the western desert state of Rajasthan near the border with Pakistan. In response, Pakistan conducted six tests in Baluchistan.
In the same year, Pakistan tested its longest range missile, the 1,500 km (932 mile) Ghauri missile, named after a 12th Century Muslim warrior who conquered part of india.
Both sides were heavily criticised by the international community for the tests as fears of a nuclear confrontation grew.
The United States ordered sanctions against both countries, freezing more than $20bn of aid, loans and trade. Japan ordered a block on about $1bn of aid loans.
Several European countries followed suit, and the G-8 governments imposed a ban on non-humanitarian loans to India and Pakistan.
The UN Security Council condemned India and Pakistan for carrying out nuclear tests and urged the two nations to stop all nuclear weapons programmes.
Relations between India and Pakistan improved again in February 1999 when Indian Prime Minister Atal Vajpayee travelled to Pakistan to meet Pakistani Prime Minister Nawaz Sharif.
They signed the Lahore accord pledging again to "intensify their efforts to resolve all issues, including the issue of Jammu and Kashmir".
India had detonated its first nuclear device in1974. In 1989, Pakistan announced the successful test firing of its first long-range surface-to-surface missile, the Hatf-1 and Hatf-2.
In 1992 Pakistan said it had acquired the scientific know-how to make a nuclear bomb.
Conflict again erupted after India launched air strikes against Pakistani-backed forces that had infiltrated Indian-administered Kashmir. Fighting built up towards a direct conflict between the two states and tens of thousands of people were reported to have fled their homes on both sides of the ceasefire line. Later that year, General Musharraf led a military coup in Pakistan.
A bus from Pakistan carrying a sick child and 27 passengers ended its historic journey in the Indian capital, marking the establishment of road links between the two South Asian rivals, July 2003.
The buses are the first cross-border transport links between the neighbours since ties snapped after a December 13, 2001, attack on the Indian parliament by gunmen New Delhi claims were backed by Islamabad. Pakistan denies the allegation.
For the first time in nearly 30 years, in May 1999, India launched air strikes against Pakistani-backed forces that had infiltrated into the mountains in Indian-administered Kashmir, north of Kargil.
Pakistan responded by putting its troops on high alert as the fighting built up towards a direct conflict between the two states.
India repeatedly claimed that Pakistani forces belonging to the northern light infantry, based in the Pakistani-administered Northern Areas, were engaged in the operations - a claim Pakistan consistently denied.
Pakistan insisted instead that the forces were "freedom fighters" fighting for the liberation of Indian-administered Jammu and Kashmir.
At the height of the conflict, thousands of shells were fired daily, and India launched hundreds of airstrikes. The Red Cross reported that at least 30,000 people had been forced to flee their homes on the Pakistani side of the Line of Control.
Correspondents reported that about 20,000 people became refugees on the Indian side.
Both sides claimed victory in the conflict, which ended when, under pressure from the United States, Prime Minister Nawaz Sharif called upon the infiltrating forces to withdraw.
In October 1999, General Pervez Musharraf led a military coup in Pakistan, deposing elected Prime Minister Nawaz Sharif. General Musharraf's assumption of power was later validated by the supreme court of Pakistan for a period of three years.
The coup was, however, was condemned by the international community which called for elections and an immediate return to civilian government. Pakistan was also suspended from the Commonwealth.
Tension along the ceasefire line continued. In October 38 people were killed after an attack on the Kashmiri assembly in Srinagar. A month later, 14 people were killed in an attack on the Indian parliament in Delhi. India again blamed Pakistani-backed Kashmiri militants. A dramatic build up of troops along the Indo-Pakistan border ensued.
The 11 September 2001 suicide attacks in the United States brought a rapprochement between Pakistan and the West. Pakistan agreed to co-operate with the US's campaign against Osama Bin Laden's al-Qaeda network and the Taleban rulers of Afghanistan.
Tension along the line of control continued. The worst fighting for more than a year broke out in October as India, which continued to condemn Pakistan for cross-border terrorism, started shelling Pakistani military positions.
October saw a devastating attack on the Kashmiri assembly in Srinagar in which 38 people were killed. After the attack, the chief minister of Indian-administered Kashmir, Farooq Abdullah, called on the Indian government to launch a war against militant training camps across the border in Pakistan.
Supporters of the Jammu Kashmir Liberation Front, led by leader Amanullah Khan, center, in sunglasses, stage a rally, demanding freedom of Kashmir near Muzaffarabad, capital of Pakistani Kashmir, in April 7, 2004.
On 13 December, an armed attack on the Indian parliament in Delhi left 14 people dead. India again blamed Pakistani-backed Kashmiri militants. The attack led to a dramatic build-up of troops along the Indo-Pakistan border, military exchanges and raised fears of a wider conflict.
In January 2002 President Musharraf gave a keynote speech pledging that Pakistan would not allow terrorists to operate from Pakistani soil. He again called on the government of India to resolve the dispute over Jammu and Kashmir through dialogue.
India said it would wait for action to back up his words.