KABUL, Afghanistan — A Taliban suicide bomber attacked a minibus carrying Nepalese and Indian security contractors to work at the Canadian Embassy early Monday, killing 14 people in one of the deadliest attacks on foreign workers in the Afghan capital, the police and government officials said.

The Taliban quickly claimed responsibility for the bombing, along with another explosion in the city on Monday morning that wounded a Kabul provincial council member. The twin explosions shattered a relative calm in Kabul during the holy month of Ramadan, which began in early June, and underscored the Taliban’s rejection of a request by the United Nations for a cease-fire that would last the month.

Thousands of Nepalese security contractors, in particular, work at foreign military or diplomatic compounds in Afghanistan, many drawn to work here by better wages and more jobs than are available for them back home. Despite tight security measures at the foreign missions where they work, or surrounding their barracks, the contractors often travel to work in unguarded buses that are seen as especially vulnerable to insurgent attacks.

The minibus carrying the contractors was traveling through the eastern part of Kabul when it was attacked by a bomber wearing an explosive belt and traveling on foot, security officials said. Sediq Sediqqi, the spokesman for the Ministry of Interior, put the death toll at 14, with eight more people wounded, some of whom might also have been civilians.

Zabihullah Mujahid, a Taliban spokesman, made the claims of responsibility on Twitter and gave a higher death toll for the bus bombing, saying that 20 foreign guards had been killed.

Later on Monday, a branch of the Islamic State also claimed responsibility for the bombing, according to the SITE Institute, which tracks jihadist groups. It was impossible to reconcile the competing claims. The Islamic State statement mistakenly asserted that the Nepalese contractors worked at the American Embassy rather than the Canadian Embassy.

Canada’s ambassador to Afghanistan, Deborah A. Lyons, said in a statement that 12 of the victims were from Nepal and two were from India. “Many of the men killed today have been part of our embassy family for many years,” she said.

In the second bombing in Kabul, Attaullah Faizani, a member of Kabul’s provincial council, was wounded along with two other people when an explosive device detonated about 40 yards from the council member’s home, according to Fraidoon Obaidy, a senior police official in Kabul.

In a separate bombing, 10 people, including some children, were killed in the northeastern province of Badakhshan when an explosive-laden motorcycle detonated in a traffic roundabout, local officials said. The Taliban officially denied that they were behind that bombing, as they have with some other attacks in which most of the victims were civilians. But later, Taliban commanders in the province told a reporter that the group was, in fact, responsible the bombing.

The surge of violence on Monday highlighted the challenges facing the government as a resurgent Taliban has expanded its territory over the last year. But as the threats have escalated, the post of defense minister has been left vacant for months, fueling a perception that the Afghan government had yielded its authority over the war effort to American commanders.

On Monday, the Afghan parliament approved a nominee, Gen. Abdullah Khan Habibi, as defense minister, after numerous previous attempts to fill the post had failed since the government was first installed in September 2014. General Habibi, 64, had served in the armed forces or defense ministry under several previous Afghan administrations – including under Taliban rule, military officials said.

Reporting was contributed by Zahra Nader and Rod Nordland from Kabul, and by an employee of The New York Times in Afghanistan.

Get news and analysis from Asia and around the world delivered to your inbox every day with the Today’s Headlines: Asian Morning newsletter. Sign up here.

A version of this article appears in print on , Section A, Page 7 of the New York edition with the headline: Foreign Security Contractors Are Killed by Bomb in Kabul. Order Reprints | Today’s Paper | Subscribe