NEW DELHI: Taliban militants launched a brazen attack on the Afghan parliament on Monday, sending the country’s lawmakers running for cover and killing five people and injuring 31.

The attack ended after two hours of gunfire resulted in killing all seven attackers. “First a car bomb detonated on the main road near the parliament building, then a group of attackers entered a building in front of parliament,” Kabul police spokesperson Ebadullah Karimi told AFP.

Afghan President Ashraf Ghani condemned the attack. TOLO News reports: “Afghan President Ashraf Ghani has condemned Monday's attack on Parliament, saying the targeting of civilians during the month of Ramazan is un-Islamic and that those responsible are simply criminals. Ghani said in a statement issued by the Presidential Palace that "those conducting such terrorist attacks are criminals who fail to obey the [country's] laws or Islam".

Neighbouring Pakistan also issued a statement saying, “The Government of Pakistan reiterates its condemnation of terrorism in all its forms and manifestations. We reaffirm our resolve to fight terrorism in close coordination with the Government of Afghanistan. We stand with our Afghan brothers in our common struggle against terrorism."

Indian Prime Minister Narendra Modi issued a strong condemnation. "The attack on the Afghanistan Parliament is a despicable and cowardly act. There is no place for such attacks in a democracy," he tweeted. "My prayers are with those injured. We stand shoulder to shoulder with the people of Afghanistan in this hour.”

The Taliban claimed responsibility for the attack. TOLO News reports: “A Taliban spokesman, Zabihullah Mujahid, in his Twitter claimed responsibility for the attack.”

The attack, targeting high profile political representatives in downtown Kabul, raises questions about insurgency in Afghanistan -- where Taliban militants seem to be gaining ground and violence has resulted in a record number of deaths this year.

A day earlier, reports indicated that the militants were advancing on the capital of a key northern Afghan province after having captured its adjoining district. The Taliban captured Kunduz after launching its “spring offensive” in April, setting civilian casualties skyrocketing. The violence has placed civilian casualties at their highest in 2015, compared to similar durations in preceding years.

Meanwhile, reports circulate on talks to discuss the potential modalities of comprehensive peace negotiations with Taliban representatives. At a press conference last week, Ministry of Foreign Affairs (MoFA) spokesman Ahmad Shekib Mustaghni confirmed that the government had sent the delegation, which, led by Mohammad Mohaqeq, the Second Deputy of Chief Executive Abdullah Abdullah, also includes Deputy Foreign Minister Hikmat Khalil Karzai, former speaker of parliament Mohammad Younas Qanooni, former minister of women's affairs Husn Bano Ghazanfar, former minister of commerce Anwarulhaq Ahadi and a member of the High Peace Council (HPC), Farhadullah Farhad.

As the prospect of talks loom just out of reach, the Taliban continues to step up violence. In fact, in its annual report released earlier in the year, the UN Mission in Afghanistan has said that the number of civilians killed or wounded in the troubled country climbed by 22 percent in 2014 to reach the highest level since 2009.

The UN agency documented 10,548 civilian casualties in 2014, the highest number of civilian deaths and injuries recorded in a single year since 2009. They include 3,699 civilian deaths, up 25 per cent from 2013 and 6,849 civilian injuries, up 21 per cent from 2013. Since 2009 -- when UNAMA began tracking casualties -- the armed conflict in Afghanistan has caused 47,745 civilian casualties with 17,774 Afghan civilians killed and 29,971 injured.

The UN says that Taliban militants -- who have been waging an insurgency in Afghanistan since a US-led invasion toppled their government 13 years ago -- were responsible for 72 per cent of all civilian casualties, with government forces and foreign troops responsible for 14 percent.

At one point, the peace talks looked set to fail as the Taliban vowed to push through with the “summer offensive” following the White House’s announcement that the United States will maintain its current 9800 troops in Afghanistan through the end of 2015, as opposed to an earlier plan of cutting the number to 5500. The Taliban reacted sharply to the statement with Taliban spokesman Zabihullah Mujahid saying, “This damages all the prospects for peace … This means the war will go on until they are defeated.”

Other factors also contributed to making the talks a difficult proposition. For one, the rift between the top two leaders of the militant group. The two in question are political leader Akhtar Mohammad Mansour, who favors negotiation, and battlefield commander Abdul Qayum Zakir, a former Guantanamo Bay detainee, who opposes any dialogue with the Afghan leadership. Sources state that the two met recently to address their personal differences, but no headway could be made on the issue of talks, with Zakir of the view that the Afghan government was illegitimate and that real power remained with the US any way.

The announcement of the change in plans of troop withdrawal tilted the position in favour of Zakir, with the Taliban command being clear from the start that the removal of foreign troops would be one of the prerequisites for the commencement of talks.

The talks, however, seemed to have pulled through, albeit only in the form of a start as of now. Months of informal and formal dialogue in Qatar, China, Norway and Dubai paved the way for this meeting in Oslo.

TOLO spoke to former Taliban commander Syed Akbar Agha about the talks. "If consultations and meetings between the government of Afghanistan and the Taliban are conducted on a regular basis, it would bear positive outcomes on the issues facing Afghanistan," Syed Akbar Agha said.

While the talks finally seeming possible is a major achievement, bottlenecks do remain. This is evinced by the fact that the Taliban recently rejected a call from the Afghan Religious Scholars' Council to put in place a ceasefire during the holy month of Ramadan.

Another factor that may play spoiler is Afghanistan’s relationship with Pakistan, the latter being crucial to the talks owing to its leverage over the Taliban leadership. The two countries recently signed an agreement between Afghan National Directorate of Security (NDS) and Pakistan’s Inter Services Intelligence (ISI).

Pakistan and Afghanistan have thus far shared a tense history, which the new Afghan President Ashraf Ghani has set to improve, partly because of Pakistan’s influence over the insurgents. This influence, however, has been the main source of ammunition for Ghani’s anti-Pakistan critics, who are accusing the Afghan leader of sleeping with the enemy so to speak.

When Ghani came to power in September last year, he quickly signalled a change in policy. Ghani soon after being sworn-in visited Pakistan, and then Pakistan’s army chief and head of intelligence visited Kabul. Afghanistan and Pakistan’s tense equation had sunk to an all-time low under the presidency of former Afghan President Hamid Karzai. Karzai had been openly critical of Pakistan -- accusing the neighbouring country of supporting the Afghan Taliban and providing refuge to the group’s leadership.

Ghani, unlike his predecessor, reached out to Pakistan. Delegations from the two countries made visits across the border; six Afghan army cadets were sent to Pakistan for training; military efforts were coordinated across the shared border; and Ghani and Pakistani Prime Minister Nawaz Sharif both issued statements in support of cooperation and bilateral ties.

The shift in policy seemed to be bearing fruit, with reports circulating that the Afghan Taliban -- under pressure from Pakistan was on the verge of agreeing to talks with the Afghan leadership. This was huge. For the first time in thirteen years -- since the US invasion of Afghanistan -- the Taliban, which has thus far maintained that the Afghan government is illegitimate, was ready to initiate a peace process.

Pakistan’s support was the crucial factor in enabling talks. A report in The Express Tribune quoted an unnamed former top commander of the group saying, “Taliban officials, who had been involved in talks with the Pakistanis and the Chinese, and had sought time for consultations with the senior leaders, have received a green signal from the leadership,” adding that “Pakistani officials had advised Taliban leaders to sit face-to-face with the Afghan government and put their demands to find out a political solution to the problem.” The same report quoted another unnamed Taliban source confirming the report and adding that “a small delegation will be visiting Pakistan in days for consultations” to be able to take the discussion with the Afghan government forward.

Then Ghani’s trip to Washington happened, where US President Barack Obama announced the decision to slow troop withdrawal. The Taliban, in turn, issued a statement vowing to continue fighting. "This damages all the prospects for peace, Taliban spokesman Zabihullah Mujahid said of the announcement. “This means the war will go on until they are defeated.”

In fact, Ghani’s predicament -- of needing the US and wanting to begin a dialogue with the Taliban -- is reflected in a statement made by the Afghan President whilst in Washington. Ghani issued an apology -- of sorts -- to the Taliban. He said that peace with the militants was “essential” and that some Taliban members suffered legitimate grievances. "People were falsely imprisoned, people were tortured. They were tortured in private homes or private prisons," Ghani said (as reported by Reuters). “How do you tell these people that you are sorry?" he added.

All this has been the source of much criticism. In an interview with The Guardian, former Afghan President Hamid Karzai -- said that the country’s historic struggles against British imperialism and Soviet invasion will have been in vain if it succumbs to pressure from Pakistan.

This view was echoed by Karzai’s associates who sat in on the interview. Rangin Dadfar Spanta, a former foreign minister and national security adviser said that the policy amounts to the humiliating “appeasement” of a hostile power who would never change its ways. In a similar vein, Omar Daudzai, one of the most influential officials of the Karzai era who served as chief of staff and interior minister, predicts, “There could be a bloody summer, there will be fighting and there will be disappointments on the dialogue table from time to time.” Daudzai, a former ambassador to Islamabad, added that whilst he thought Ghani’s attempts to woo Pakistan were “courageous,” they would ultimately fail to change the country’s behaviour. “He has taken controversial steps that his predecessor didn’t take, and now we have to wait to see whether the Pakistani side is sincere or not,” he said. “But I am far more sceptical than I ever was before about Pakistan’s sincerity.”

And this is by no means an isolated view. An important figure within Afghanistan, Karzai echoes a distrust that runs deep with the Afghan people. Ghani, therefore, will inevitably -- sooner rather than later -- begin to face pressure in showing that his policy translates into results beneficial to Afghanistan.