As Indian rulers declined in power, the Timurid Dynasty entered the region from Central Asia in the 1500s. Eventually this empire entered India and one of its offshoots became the Islamic Mughal Empire. As they moved east they built up numerous cities, including Lahore as they encouraged religious tolerance, although they were Muslim.
Mughal rule in Pakistan continued until 1739 when the Afsharid dynasty from Persia took power, creating the Durrani Empire. However this empire didn't last long in Pakistan and soon were overthrown, although not without wars and attempts, some successful, to regain control. By 1799 the Sikh Empire had taken control over most of the region. Again, this rule didn't last long as the British arrived in the 1800s and by 1849 had defeated the Sikhs, establishing British India, which included modern day Pakistan.
Almost immediately the people of Pakistan fought British rule and independence movements arose in the late 1800s. This led to the creations of the Muslim League in 1906, whose initial goals were to guarantee rights for Muslims in a territory that was overwhelmingly Hindi. Sadly this was viewed as a threat by many Hindus and division among the people by religion began.
Soon division among the Muslims and Hindis in India was widening as many Muslims sought immediately independence from Britain, while many Hindus stood behind Gandhi's stance of non-violence, which required more time and patience. This difference in methodology led to the formation of Pakistan. However, the Muslim League was losing proponents among the Muslims as well, as the people were divided in opinion; some people wanted independence immediately, others supported a longer, non-violence approach, while they also argued over whether to remain with India after independence or to become a separate nation.
By 1940 India was at war, getting involved on the side of the Britain in World War II, and the Muslim majority in Pakistan was slowly coming to believe that no united nation was possible after independence. As WWII came to a close Britain let India go as India formed one country and Pakistan (which included modern day Bangladesh at the time) formed another country in 1947.
Unfortunately, the borders were questioned so both Punjab and Bengal were divided among the two countries. This led to the movement of people: Hindus to India and Muslims to Pakistan, but this came with much violence. These areas broke out in war as trains moving from one country to the other were at times stopped as the people were massacred on both sides. There was also argument over the region of Kashmir, which both countries claimed, leading to war and India eventually gaining control over the region.
In the same year, 1947 war broke out between India and Pakistan as border disputes continued and fighting on the borders continued. This led to great nationalism in Pakistan, which unintentionally led to excluding the people of East Pakistan (modern day Bangladesh).
Due to all these early problems facing Pakistan in the 1950s, the military stepped in and took over the government, creating an Islamic Republic. This chaos led to full war with India in 1965 leading to greater military control, until 1970 when the military stepped aside to a degree and allowed free elections. These elections showed the drastic difference between east and west Pakistan, leading to the separation of east Pakistan, creating the country of Bangladesh in 1971. This action was not recognized by Pakistan at the time, but India encouraged the separation.
India's recognition of Bangladesh also led to increased hostilities between India and Pakistan, but also represented the return of a democracy in Pakistan. Leader, Zulfikar Bhutto developed great changes, including a growing technology to obtain the atomic bomb, to counteract India. The 1970s were a time of unifying the country, while also militarizing. This culminated in 1977 when the military again took over.
Under military rule from 1977 to 1988 the military government purged numerous detractors and restricted rights on numerous levels. This ended in 1988 when Benazir Bhutto took power. During the 1980s and 1990s the country tried to balance between numerous international interests, at times working with the Soviets, at other the United States and working with the Taliban in Afghanistan. It also was a time when relations with India again worsened as India began undergoing nuclear bomb testing. Pakistan responded by announcing that they had successfully create a nuclear bomb in the late 1990s.
In 1999 military power again took control in Pakistan as numerous politicians were exiled. In 2001, after the al Qaeda attacks on the United States, Pakistani President Pervez Musharraf supported the United States in their quest to oust Taliban rule in Afghanistan. The people generally disagreed with this decision and most of the Taliban and Al Qaeda fugitives fled from Afghanistan into Pakistan.
In 2007 numerous exiled politicians, including former Prime Minister Nawaz Sharif and former President Benazir Bhutto returned. This led to numerous assassination attempts, which found themselves successful when Bhutto was killed later that year. The following year Musharraf stepped down from office and relations with many western countries severely diminished. This was further escalated when in 2011 the United States entered Pakistan without their permission to kill Osama bin Laden, the leader of al Qaeda and mastermind of the September 11, 2001 attack on the United States.
Today Pakistan remains unstable at best as politics and personal opinions are divided on nearly every issue. Additionally, the government and people struggle to find international allies as there seems to be little cohesiveness on what direction the country should head.