At least 30 people were killed and 45 injured in two Taliban attacks in Afghanistan on Tuesday as the country prepares for elections later this month. In the country's northern Parwan province, a sticky bomb attached to a police vehicle detonated near a campaign rally by President Ashraf Ghani. In a separate incident, a blast in the centre of the capital Kabul, close to the city’s Massoud Square and near an army base and the US embassy, killed at least six people, police officials said. The Taliban claimed responsibility for both blasts, saying they had attacked Afghan security forces and that dozens had been killed. The president's campaign spokesman Hamed Aziz said that Mr Ghani was safe and unharmed. Most presidential candidates had suspended their campaigns while negotiations between the Taliban and the US were taking place and as the US peace envoy, Zalmay Khalilzad, said a deal was all but signed. But US President Donald Trump posted tweets at the beginning of September declaring the deal and the talks were "dead", launching the war-battered nation on an election campaign. Militant attacks have increased in recent weeks as the country prepares to go to the polls amid the stalling peace talks with the United States, which sought the removal of its troops. The negotiations, which did not include the Afghan government, were intended as a prelude to intra-Afghan negotiations. Security at election rallies across the country has been tight after the Taliban said they would target any events that appeared to celebrate a vote that it deems to be illegitimate. While Washington has been seeking an exit to its longest war, the Taliban are at their strongest since the 2001 US invasion and hold sway over more than half the country, staging deadly attacks on a near-daily basis. It was two attacks in Kabul in recent weeks that caused Mr Trump to halt the negotiations with the Taliban, including one that killed two Nato soldiers, one of whom was an American. Another U.S. soldier died in combat in Afghanistan on Monday. Monday's death was the 17th US combat death in Afghanistan this year, according to the Pentagon's count. There also have been three non-combat deaths this year. More than 2,400 Americans have died in the nearly 18-year war. Also on Tuesday, a Taliban delegation visited Iran to discuss prospects for peace in Afghanistan. The semi-official Borna news agency said the delegation discussed "the latest" developments. Iran said such talks had taken place in the past and that it would continue to enable talks between the insurgents and the Afghan government. Last week, the Taliban's made its <a href="https://www.thenational.ae/world/asia/taliban-visits-moscow-days-after-trump-says-talks-dead-1.910004">first international visit after the collapse of talks, heading to Moscow</a>. Observers had warned the Taliban, who hope to weaken the future president, will do anything they can to upend the election. On the first day of campaigning in July, suicide attackers and gunmen targeted the Kabul office of Mr Ghani's running mate, Amrullah Saleh. At least 20 people died in those attacks. Turnout in the elections is set to be low, with experts citing fear of violence and a loss of hope among voters following widespread fraud allegations during the 2014 election.